forked from rougier/nano-emacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nano-session.el
83 lines (76 loc) · 3.38 KB
/
nano-session.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
;; ---------------------------------------------------------------------
;; GNU Emacs / N Λ N O - Emacs made simple
;; Copyright (C) 2020 - N Λ N O developers
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;; ---------------------------------------------------------------------
;; Save miscellaneous history
(setq savehist-additional-variables
'(kill-ring
command-history
set-variable-value-history
custom-variable-history
query-replace-history
read-expression-history
minibuffer-history
read-char-history
face-name-history
bookmark-history
ivy-history
counsel-M-x-history
file-name-history
counsel-minibuffer-history))
(setq history-length 250)
(setq kill-ring-max 25)
(put 'minibuffer-history 'history-length 50)
(put 'file-name-history 'history-length 50)
(put 'set-variable-value-history 'history-length 25)
(put 'custom-variable-history 'history-length 25)
(put 'query-replace-history 'history-length 25)
(put 'read-expression-history 'history-length 25)
(put 'read-char-history 'history-length 25)
(put 'face-name-history 'history-length 25)
(put 'bookmark-history 'history-length 25)
(put 'ivy-history 'history-length 25)
(put 'counsel-M-x-history 'history-length 25)
(put 'counsel-minibuffer-history 'history-length 25)
(setq savehist-file "~/.nano-savehist")
(savehist-mode 1)
;; Remove text properties for kill ring entries
;; See https://emacs.stackexchange.com/questions/4187
(defun unpropertize-kill-ring ()
(setq kill-ring (mapcar 'substring-no-properties kill-ring)))
(add-hook 'kill-emacs-hook 'unpropertize-kill-ring)
;; Recentf files
(setq recentf-max-menu-items 25)
(setq recentf-save-file "~/.nano-recentf")
(recentf-mode 1)
;; Bookmarks
(setq bookmark-default-file "~/.nano-bookmark")
;; Backup
(setq backup-directory-alist '(("." . "~/.backups"))
make-backup-files t ; backup of a file the first time it is saved.
backup-by-copying t ; don't clobber symlinks
version-control t ; version numbers for backup files
delete-old-versions t ; delete excess backup files silently
kept-old-versions 6 ; oldest versions to keep when a new numbered
; backup is made (default: 2)
kept-new-versions 9 ; newest versions to keep when a new numbered
; backup is made (default: 2)
auto-save-default t ; auto-save every buffer that visits a file
auto-save-timeout 20 ; number of seconds idle time before auto-save
; (default: 30)
auto-save-interval 200) ; number of keystrokes between auto-saves
; (default: 300)
(provide 'nano-session)