Less messy backup files

This commit is contained in:
outfoxxed 2023-01-16 19:21:10 -08:00
parent 35d2b6a97d
commit ed802de0c7
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

12
init.el
View file

@ -49,6 +49,18 @@
(add-hook 'lisp-mode-hook 'disable-tabs)
(add-hook 'emacs-lisp-mode-hook 'disable-tabs)
(let ((savedir (concat (file-name-as-directory (getenv "XDG_DATA_HOME")) "emacs/autosave/")))
(make-directory savedir t)
(setq backup-directory-alist `(("." . ,savedir)))
(setq auto-save-list-file-prefix (concat savedir ".saves-"))
(setq auto-save-file-name-transforms `((".*" ,savedir t)))
(setq tramp-auto-save-directory savedir))
(setq backup-by-copying t
delete-old-versions t
version-control t
kept-new-versions 2
kept-old-versions 2)
;; Packages
(require 'use-package)