chore(editor): extract recentf, savehist and uniquify to seperate modules

This commit is contained in:
2021-06-24 19:16:16 +01:00
parent b53cef4d30
commit 654eae72ff
5 changed files with 79 additions and 39 deletions

View File

@@ -0,0 +1,33 @@
;;; siren-recentf.el --- jimeh's Emacs Siren: recentf configuration.
;;; Commentary:
;; Basic configuration for recentf.
;;; Code:
(use-package recentf
:straight (:type built-in)
:demand t
:custom
(recentf-save-file (expand-file-name "recentf" siren-cache-dir))
(recentf-max-saved-items 5000)
(recentf-max-menu-items 1000)
(recentf-auto-cleanup 'never)
(recentf-exclude '("\\.git.*" "\\.hg.*" "\\.svn.*"))
:init
(defun siren-recentf-exclude-p (file)
"A predicate to decide whether to exclude FILE from recentf."
(let ((file-dir (file-truename (file-name-directory file))))
(-any-p (lambda (dir)
(string-prefix-p dir file-dir))
(mapcar 'file-truename (list siren-cache-dir package-user-dir)))))
:config
(add-to-list 'recentf-exclude 'siren-recentf-exclude-p)
(recentf-mode +1))
(provide 'siren-recentf)
;;; siren-recentf.el ends here

View File

@@ -0,0 +1,21 @@
;;; siren-savehist.el --- jimeh's Emacs Siren: savehist configuration.
;;; Commentary:
;; Basic configuration for savehist.
;;; Code:
(use-package savehist
:straight (:type built-in)
:custom
(savehist-additional-variables '(search-ring regexp-search-ring))
(savehist-autosave-interval 60)
(savehist-file (expand-file-name "savehist" siren-cache-dir))
:init
(savehist-mode +1))
(provide 'siren-savehist)
;;; siren-savehist.el ends here

View File

@@ -0,0 +1,22 @@
;;; siren-uniquify.el --- jimeh's Emacs Siren: uniquify configuration.
;;; Commentary:
;; Basic configuration for uniquify.
;;; Code:
(use-package uniquify
:straight (:type built-in)
:demand t
:custom
(uniquify-buffer-name-style 'post-forward-angle-brackets)
(uniquify-separator "/")
;; rename after killing uniquified
(uniquify-after-kill-buffer-p t)
;; don't muck with special buffers
(uniquify-ignore-buffers-re "^\\*"))
(provide 'siren-uniquify)
;;; siren-uniquify.el ends here