wip: feat: Autosaving and recent files
This commit is contained in:
@@ -51,16 +51,7 @@ in {
|
||||
sydnix.impermanence.cache.directories = [ straightBaseDir ];
|
||||
home.packages = [ emacsWrapper ];
|
||||
|
||||
# home.sessionVariables.EMACS_STRAIGHT_BASE_DIR = straightBaseDir;
|
||||
|
||||
# programs.emacs = {
|
||||
# enable = true;
|
||||
# package = emacsPackage;
|
||||
# # extraConfig = ''
|
||||
# # (load (file-name-concat "${emacsConfigDir}" "init"))
|
||||
# # '';
|
||||
# };
|
||||
|
||||
# TODO: Make sure this is using the right package for Emacs...
|
||||
services.emacs = {
|
||||
enable = true;
|
||||
# Generate a desktop entry for emacsclient.
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
(with-current-buffer url-buffer
|
||||
(goto-char (point-max))
|
||||
(eval-print-last-sexp))))
|
||||
(load-file bootstrap-file)
|
||||
;; (load bootstrap-file nil 'nomessage)
|
||||
)
|
||||
(load-file bootstrap-file))
|
||||
|
||||
(setq straight-use-package-by-default t))
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
;; Initialise Straight.el.
|
||||
|
||||
(load (locate-user-emacs-file "init-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 "lib"))
|
||||
|
||||
(require 'syd-evil)
|
||||
(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