More sensible backup/auto-save defaults
More sensible defaults. And save tramp backups locally, to prevent excessive remote writes.
This commit is contained in:
parent
98826f33d0
commit
b4e66bffeb
1 changed files with 11 additions and 11 deletions
|
@ -85,23 +85,23 @@ possible."
|
||||||
;; potentially sensitive material floating around our filesystem.
|
;; potentially sensitive material floating around our filesystem.
|
||||||
(setq create-lockfiles nil
|
(setq create-lockfiles nil
|
||||||
make-backup-files nil
|
make-backup-files nil
|
||||||
;; But have a place to store them in case we do use them...
|
;; But in case the user does enable it, some sensible defaults:
|
||||||
;; auto-save-list-file-name (concat doom-cache-dir "autosave")
|
version-control t ; number each backup file
|
||||||
auto-save-list-file-prefix (concat doom-cache-dir "autosave/")
|
backup-by-copying t ; instead of renaming current file (clobbers links)
|
||||||
auto-save-file-name-transforms `((".*" ,auto-save-list-file-prefix t))
|
delete-old-versions t ; clean up after itself
|
||||||
backup-directory-alist `((".*" . ,(concat doom-cache-dir "backup/"))))
|
kept-old-versions 5
|
||||||
|
kept-new-versions 5
|
||||||
|
backup-directory-alist (list (cons "." (concat doom-cache-dir "backup/"))))
|
||||||
|
|
||||||
;; But turn on auto-save, so we have a fallback in case of crashes or lost data.
|
;; But turn on auto-save, so we have a fallback in case of crashes or lost data.
|
||||||
;; Use `recover-file' or `recover-session' to recover them.
|
;; Use `recover-file' or `recover-session' to recover them.
|
||||||
(setq auto-save-default t
|
(setq auto-save-default t
|
||||||
;; Don't auto-disable auto-save after deleting big chunks. Kind of
|
;; Don't auto-disable auto-save after deleting big chunks. Kind of
|
||||||
;; defaults the purpose of a fallback in case of crashes.
|
;; defaults the purpose of a fallback in case of crashes.
|
||||||
auto-save-include-big-deletions t)
|
auto-save-include-big-deletions t
|
||||||
|
;; ...but have directories set up in case we use it.
|
||||||
(after! tramp
|
auto-save-list-file-prefix (concat doom-cache-dir "autosave/")
|
||||||
;; Backing up files on remotes can be incredibly slow and prone to a variety
|
auto-save-file-name-transforms (list (list ".*" auto-save-list-file-prefix t)))
|
||||||
;; of IO errors. Better to disable it altogether in tramp buffers:
|
|
||||||
(add-to-list 'backup-directory-alist (cons tramp-file-name-regexp nil)))
|
|
||||||
|
|
||||||
(add-hook! 'after-save-hook
|
(add-hook! 'after-save-hook
|
||||||
(defun doom-guess-mode-h ()
|
(defun doom-guess-mode-h ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue