Shaving MILLISECONDS off our startup time!!! Fuck yes! I've measured the average startup time to be 0.68s in the previous commit, and an average of 0.52 with this commit.
37 lines
1.2 KiB
EmacsLisp
37 lines
1.2 KiB
EmacsLisp
;;; 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 your cursor position in recently-opened files.
|
||
(use-package saveplace
|
||
:hook (on-first-file . save-place-mode)
|
||
:custom (save-place-file (file-name-concat syd-cache-dir "places")))
|
||
|
||
;; Keep track of recently-visited files.
|
||
(use-package recentf
|
||
:hook ((on-first-file . recentf-mode)
|
||
(find-file-hook . recentf-save-list))
|
||
:custom (recentf-save-file (file-name-concat syd-data-dir "recentf")))
|
||
|
||
|
||
(provide 'syd-autosave)
|