-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path+defaults.el
More file actions
269 lines (223 loc) · 10.4 KB
/
+defaults.el
File metadata and controls
269 lines (223 loc) · 10.4 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
;;; +defaults.el -*- lexical-binding: t; -*-
;; SIMPLE SETTINGS
(setq-default
delete-by-moving-to-trash t ; Delete files to trash
window-combination-resize t ; take new window space from all other windows (not just current)
x-stretch-cursor t) ; Stretch cursor to the glyph width
(setq-default line-spacing 0)
(setq undo-limit 80000000 ; Raise undo-limit to 80Mb
evil-want-fine-undo t ; By default while in insert all changes are one big blob. Be more granular
auto-save-default t ; Nobody likes to loose work, I certainly don't
password-cache-expiry nil ; I can trust my computers ... can't I?
scroll-margin 2 ; It's nice to maintain a little margin
display-time-default-load-average nil ; I don't think I've ever found this useful
truncate-string-ellipsis "…") ; Unicode ellispis are nicer than "...", and also save /precious/ space
(global-subword-mode 1)
(display-time-mode 0)
(setq display-time-format ".::. %a %e %b %H:%M .::.")
(setq display-time-interval 60)
;; Disabling fringes
(fringe-mode '(0 . 0))
;; Prevents some cases of Emacs flickering
(add-to-list 'initial-frame-alist '(fullscreen . maximized))
(add-to-list 'default-frame-alist '(fullscreen . fullheight))
(add-to-list 'default-frame-alist '(inhibit-double-buffering . t))
(add-to-list 'exec-path "~/bin")
(add-to-list 'exec-path "~/.local/bin")
(cua-mode t)
;; Switch to the new window after splitting
(setq evil-split-window-below t
evil-vsplit-window-right t)
(defadvice! prompt-for-buffer (&rest _)
:after '(evil-window-split evil-window-vsplit)
(consult-buffer))
(keychain-refresh-environment)
;; Store my bookmarks in my private directory
(setq bookmark-default-file (expand-file-name "private/bookmarks" doom-user-dir))
(setq evil-mode-line-format nil
evil-insert-state-cursor '(bar "Gold1")
evil-visual-state-cursor '(box "#F86155")
evil-normal-state-cursor '(box "DeepSkyBlue3"))
(cond (IS-MAC (menu-bar-mode t)))
(solaire-global-mode t)
(rainbow-mode 1)
(global-anzu-mode +1)
(global-set-key (kbd "C-;") 'iedit-mode)
(setq dired-recursive-deletes 'always)
(setq dired-listing-switches "-alh")
(yas-global-mode 1)
;; (setq yas-snippet-dirs '("~/.doom.d/snippets/"))
(setq yas-triggers-in-field t)
(setq window-divider-default-right-width 1)
(setq window-divider-default-bottom-width 1)
(setq window-divider-default-places 'right-only)
(add-hook 'after-init-hook #'window-divider-mode)
;; `org-indent-mode' does not play nice with git-gutter, so let's disable it
(setq git-gutter:disabled-modes '(org-mode))
(global-git-gutter+-mode 1)
;; colorized dired https://github.com/purcell/diredfl
(diredfl-global-mode t)
(setq-default tab-always-indent 'complete)
(setq-default indent-tabs-mode nil)
;; turn on abbrev mode globally
(setq-default abbrev-mode t)
(add-hook 'text-mode-hook #'abbrev-mode)
(setq-default save-abbrevs 'silent)
(setq-default abbrev-file-name "~/.doom.d/abbrev_defs")
(if (file-exists-p abbrev-file-name)
(quietly-read-abbrev-file))
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq-default
display-line-numbers-current-absolute nil ;; Current line is 0
display-line-numbers-type 'relative ;; Prefer relative numbers
display-line-numbers-width 2 ;; Enforce width to reduce computation
)
(dolist (mode '(org-mode-hook
term-mode-hook
shell-mode-hook))
(add-hook mode (lambda () (display-line-numbers-mode 0))))
(setq truncate-lines 1)
(map! :leader
:desc "Toggle truncate lines"
"t t" #'toggle-truncate-lines)
(setq-default
ad-redefinition-action 'accept ;; Silence warnings for redefinition
cursor-in-non-selected-windows t ;; Hide the cursor in inactive windows
display-time-default-load-average nil ;; Don't display load average
fill-column 80 ;; Set width for automatic line breaks
help-window-select t ;; Focus new help windows when opened
inhibit-startup-screen t ;; Disable start-up screen
;; initial-scratch-message "" ;; Empty the initial *scratch* buffer
kill-ring-max 128 ;; Maximum length of kill ring
load-prefer-newer t ;; Prefers the newest version of a file
mark-ring-max 128 ;; Maximum length of mark ring
scroll-conservatively most-positive-fixnum ;; Always scroll by one line
select-enable-clipboard t ;; Merge system's and Emacs' clipboard
tab-width 4 ;; Set width for tabs
vc-follow-symlinks t ;; Always follow the symlinks
view-read-only t) ;; Always open read-only buffers in view-mode
;; (cd "~/") ;; Move to the user directory
(column-number-mode 1) ;; Show the column number
(fset 'yes-or-no-p 'y-or-n-p) ;; Replace yes/no prompts with y/n
(global-hl-line-mode 1) ;; Hightlight current line
(set-default-coding-systems 'utf-8) ;; Default to utf-8 encoding
(show-paren-mode 1) ;; Show the parent
(global-aggressive-indent-mode 1)
;; (add-to-list 'aggressive-indent-excluded-modes 'python-mode)
(setq-default auto-fill-function 'do-auto-fill)
(global-visual-fill-column-mode 0)
(map! :nv "C-=" #'er/contract-region
:nv "C-+" #'er/expand-region)
(setq which-key-idle-delay 0.5)
(setq which-key-allow-multiple-replacements t)
(after! which-key
(pushnew!
which-key-replacement-alist
'(("" . "\\`+?evil[-:]?\\(?:a-\\)?\\(.*\\)") . (nil . "◂\\1"))
'(("\\`g s" . "\\`evilem--?motion-\\(.*\\)") . (nil . "◃\\1"))
))
;; https://github.com/syl20bnr/spacemacs/issues/2705
;; (setq tramp-mode nil)
(setq tramp-ssh-controlmaster-options
"-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no")
(beacon-mode 1)
;; ;; Window numbering should start from "1" for each new frame.
(setq-default winum-scope 'frame-local)
(setq calendar-week-start-day 1) ; Weeks start on monday
(setq calendar-date-style 'european)
(setq european-calendar-style t)
(setq calendar-legal-holidays
'((holiday-fixed 1 1 "New Year's Day")
(holiday-fixed 5 1 "Fête du Travail")
(holiday-fixed 5 8 "Armistice 1945")
(holiday-fixed 7 14 "Fête National")
(holiday-fixed 8 15 "Assomption")
(holiday-fixed 11 1 "Toussaint")
(holiday-fixed 11 11 "Armistice 1918")
(holiday-fixed 12 25 "Christmas")
(holiday-easter-etc 1 "Lundi de Pâques")
(holiday-easter-etc 39 "Ascension")
(holiday-easter-etc 50 "Lundi de Pentecôte")))
(setq calendar-celebration-holidays
'((holiday-fixed 2 2 "Chandeleur")
(holiday-fixed 2 14 "Fête des amoureux")
(holiday-float 3 0 1 "Fête des grands-mères")
(holiday-fixed 3 17 "St. Patrick's Day")
(holiday-fixed 4 1 "April Fools' Day")
(holiday-float 5 0 -1 "Fête des Mères")
(holiday-float 6 0 3 "Fête des Pères")
(holiday-fixed 6 21 "Fête de la musique")
(holiday-fixed 10 31 "Halloween")
(holiday-easter-etc -47 "Mardi Gras")))
(setq calendar-holidays
`(,@holiday-solar-holidays
,@calendar-legal-holidays
,@calendar-celebration-holidays))
(setq world-clock-list
'(("Pacific/Tahiti" "Tahiti")
("America/Vancouver" "Vancouver")
("America/Los_Angeles" "Los Angeles")
("America/New_York" "New York")
("America/Sao_Paulo" "Saõ Paulo")
("Europe/London" "London")
("Etc/UTC" "UTC")
("Europe/Paris" "Paris")
("Asia/Calcutta" "Calcutta")
("Asia/Shanghai" "Shanghai")
("Asia/Tokyo" "Tokyo")
("Australia/Brisbane" "Brisbane")
("Australia/Sydney" "Sydney")
("Pacific/Auckland" "Auckland")))
(setq world-clock-time-format "%a, %d %b %I:%M %p %Z")
;; Set default connection mode to SSH
(setq tramp-default-method "ssh")
;; (eval-after-load 'tramp '(setenv "SHELL" "/bin/bash"))
;; Always compile vterm
(setq vterm-always-compile-module t)
;; If the process exits, kill the vterm buffer
(setq vterm-kill-buffer-on-exit t)
(after! vterm
(define-key vterm-mode-map (kbd "<C-backspace>") (lambda () (interactive)
(vterm-send-key (kbd "C-w")))))
(after! vterm
(setf (alist-get "woman" vterm-eval-cmds nil nil #'equal)
'((lambda (topic)
(woman topic))))
(setf (alist-get "magit-status" vterm-eval-cmds nil nil #'equal)
'((lambda (path)
(magit-status path))))
(setf (alist-get "dired" vterm-eval-cmds nil nil #'equal)
'((lambda (dir)
(dired dir)))))
(setq vterm-shell "/bin/zsh")
(autoload 'muttrc-mode "muttrc-mode.el"
"Major mode to edit muttrc files" t)
(setq auto-mode-alist
(append '(("muttrc\\'" . muttrc-mode))
auto-mode-alist))
(define-key evil-normal-state-map (kbd "Q") (kbd "gqip"))
(setq sentence-end-double-space t)
(setq ibuffer-modified-char ?✍)
(setq ibuffer-read-only-char ?✗)
(setq ibuffer-marked-char ?✓)
(setq ibuffer-deletion-char ?␡)
(setq ibuffer-show-empty-filter-groups nil)
(use-package! info-colors
:after info
:commands (info-colors-fontify-node)
:hook (Info-selection . info-colors-fontify-node))
(add-hook! 'doom-init-ui-hook
(defun +keychain-startup-hook ()
"Load keychain env after emacs"
(let* ((ssh (shell-command-to-string "keychain -q --noask --agents ssh --eval"))
(gpg (shell-command-to-string "keychain -q --noask --agents gpg --eval")))
(list (and ssh
(string-match "SSH_AUTH_SOCK[=\s]\\([^\s;\n]*\\)" ssh)
(setenv "SSH_AUTH_SOCK" (match-string 1 ssh)))
(and ssh
(string-match "SSH_AGENT_PID[=\s]\\([0-9]*\\)?" ssh)
(setenv "SSH_AGENT_PID" (match-string 1 ssh)))
(and gpg
(string-match "GPG_AGENT_INFO[=\s]\\([^\s;\n]*\\)" gpg)
(setenv "GPG_AGENT_INFO" (match-string 1 gpg)))))))