wip: feat: Autosaving and recent files
This commit is contained in:
@@ -350,11 +350,13 @@ Remove a given host from =~/.ssh/known_hosts=. Something like =sed -i -e '/192.1
|
|||||||
|
|
||||||
Create a new tempdir called ~[NAME]~, and cd into it.
|
Create a new tempdir called ~[NAME]~, and cd into it.
|
||||||
|
|
||||||
*** TODO =doctor=
|
*** TODO =doctor= / =status=
|
||||||
|
|
||||||
Run various checks on the system.
|
Run various checks on the system.
|
||||||
|
|
||||||
- Sizes of caches. perhaps those listed by ~sydnix.impermanence.cache.{files,directories}~? Offer to clean them if they're getting old.
|
- Sizes of caches. perhaps those listed by ~sydnix.impermanence.cache.{files,directories}~? Offer to clean them if they're getting old or large.
|
||||||
|
|
||||||
|
- Check for available upgrades. Flake inputs, overlays, emacs packages, etc.
|
||||||
|
|
||||||
* References
|
* References
|
||||||
|
|
||||||
|
|||||||
@@ -51,16 +51,7 @@ in {
|
|||||||
sydnix.impermanence.cache.directories = [ straightBaseDir ];
|
sydnix.impermanence.cache.directories = [ straightBaseDir ];
|
||||||
home.packages = [ emacsWrapper ];
|
home.packages = [ emacsWrapper ];
|
||||||
|
|
||||||
# home.sessionVariables.EMACS_STRAIGHT_BASE_DIR = straightBaseDir;
|
# TODO: Make sure this is using the right package for Emacs...
|
||||||
|
|
||||||
# programs.emacs = {
|
|
||||||
# enable = true;
|
|
||||||
# package = emacsPackage;
|
|
||||||
# # extraConfig = ''
|
|
||||||
# # (load (file-name-concat "${emacsConfigDir}" "init"))
|
|
||||||
# # '';
|
|
||||||
# };
|
|
||||||
|
|
||||||
services.emacs = {
|
services.emacs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# Generate a desktop entry for emacsclient.
|
# Generate a desktop entry for emacsclient.
|
||||||
|
|||||||
@@ -19,8 +19,6 @@
|
|||||||
(with-current-buffer url-buffer
|
(with-current-buffer url-buffer
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(eval-print-last-sexp))))
|
(eval-print-last-sexp))))
|
||||||
(load-file bootstrap-file)
|
(load-file bootstrap-file))
|
||||||
;; (load bootstrap-file nil 'nomessage)
|
|
||||||
)
|
|
||||||
|
|
||||||
(setq straight-use-package-by-default t))
|
(setq straight-use-package-by-default t))
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
;; -*- lexical-binding: t; -*-
|
;; -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Initialise Straight.el.
|
||||||
|
|
||||||
(load (locate-user-emacs-file "init-straight"))
|
(load (locate-user-emacs-file "init-straight"))
|
||||||
(syd-initialise-straight)
|
(syd-initialise-straight)
|
||||||
|
|
||||||
|
|
||||||
|
;; Personal modules.
|
||||||
|
|
||||||
(add-to-list 'load-path (file-name-concat user-emacs-directory "modules"))
|
(add-to-list 'load-path (file-name-concat user-emacs-directory "modules"))
|
||||||
|
(add-to-list 'load-path (file-name-concat user-emacs-directory "lib"))
|
||||||
|
|
||||||
(require 'syd-evil)
|
(require 'syd-evil)
|
||||||
(require 'syd-ui)
|
(require 'syd-ui)
|
||||||
|
(require 'syd-autosave)
|
||||||
|
|||||||
39
users/crumb/programs/emacs/modules/syd-autosave.el
Normal file
39
users/crumb/programs/emacs/modules/syd-autosave.el
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
;;; syd-autosave.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(require 'syd-prelude)
|
||||||
|
|
||||||
|
(use-package emacs
|
||||||
|
:config
|
||||||
|
(setq backup-directory-alist
|
||||||
|
`(("." . (file-name-concat syd-data-dir "backup")))
|
||||||
|
;; Nil means untracked files under VC won't get backed up.
|
||||||
|
vc-make-backup-files t
|
||||||
|
;; Nil will clobber symlinks.
|
||||||
|
backup-by-copying t
|
||||||
|
;; Use versioned backups.
|
||||||
|
version-control t
|
||||||
|
auto-save-file-name-transforms
|
||||||
|
;; Good grief, girl...
|
||||||
|
`(("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'"
|
||||||
|
,(file-name-concat syd-cache-dir "autosave" "tramp-\\2") t)
|
||||||
|
(".*"
|
||||||
|
,(file-name-concat syd-cache-dir "autosave") t))
|
||||||
|
kept-new-versions 5
|
||||||
|
delete-old-versions t
|
||||||
|
save-place-file (file-name-concat syd-cache-dir "places")
|
||||||
|
bookmark-default-file (file-name-concat syd-data-dir "bookmarks")
|
||||||
|
recentf-save-file (file-name-concat syd-data-dir "recentf")))
|
||||||
|
|
||||||
|
;; Save your cursor position in recently-opened files.
|
||||||
|
(use-package saveplace
|
||||||
|
:config
|
||||||
|
(save-place-mode 1))
|
||||||
|
|
||||||
|
;; Keep track of recently-visited files.
|
||||||
|
(use-package recentf
|
||||||
|
:config
|
||||||
|
(add-hook 'find-file-hook #'recentf-save-list)
|
||||||
|
(recentf-mode 1))
|
||||||
|
|
||||||
|
|
||||||
|
(provide 'syd-autosave)
|
||||||
Reference in New Issue
Block a user