diff options
Diffstat (limited to 'accounts/gkleen@sif/emacs.el')
-rw-r--r-- | accounts/gkleen@sif/emacs.el | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/accounts/gkleen@sif/emacs.el b/accounts/gkleen@sif/emacs.el new file mode 100644 index 00000000..92a79910 --- /dev/null +++ b/accounts/gkleen@sif/emacs.el | |||
@@ -0,0 +1,111 @@ | |||
1 | (menu-bar-mode -1) | ||
2 | (scroll-bar-mode -1) | ||
3 | (tool-bar-mode -1) | ||
4 | |||
5 | (set-face-attribute 'default nil :font "FiraCode Nerd Font Mono" :height 49) | ||
6 | |||
7 | (require 'evil) | ||
8 | (evil-mode 1) | ||
9 | (setq evil-undo-system 'undo-tree) | ||
10 | |||
11 | (global-subword-mode) | ||
12 | (global-undo-tree-mode) | ||
13 | (global-fira-code-mode) | ||
14 | |||
15 | (global-set-key (kbd "RET") 'newline-and-indent) | ||
16 | (global-set-key (kbd "M-g") 'magit-status) | ||
17 | (global-set-key (kbd "M-?") 'vc-git-grep) | ||
18 | |||
19 | (setq backup-directory-alist `(("." . "~/.saves"))) | ||
20 | (setq delete-old-versions t | ||
21 | kept-new-versions 6 | ||
22 | kept-old-versions 2 | ||
23 | version-control t) | ||
24 | |||
25 | (setq undo-tree-visualizer-timestamps t | ||
26 | undo-tree-visualizer-diff t | ||
27 | ;; 10X bump of the undo limits to avoid issues with premature | ||
28 | ;; Emacs GC which truncages the undo history very aggresively | ||
29 | undo-limit 800000 | ||
30 | undo-strong-limit 12000000 | ||
31 | undo-outer-limit 120000000) | ||
32 | |||
33 | (add-hook 'haskell-mode-hook 'haskell-indentation-mode) | ||
34 | (add-hook 'haskell-mode-hook 'subword-mode) | ||
35 | (add-hook 'haskell-mode-hook 'highlight-symbol-mode) | ||
36 | (add-hook 'haskell-mode-hook 'highlight-paretheses-mode) | ||
37 | |||
38 | (add-hook 'js-mode-hook 'highlight-symbol-mode) | ||
39 | (add-hook 'js-mode-hook 'highlight-parentheses-mode) | ||
40 | (defun my-js-mode-hook () | ||
41 | "Custom `js-mode' behaviours." | ||
42 | (setq js-indent-level 2) | ||
43 | ) | ||
44 | (add-hook 'js-mode-hook 'my-js-mode-hook) | ||
45 | |||
46 | (setq undo-tree-auto-save-history t) | ||
47 | |||
48 | (setq notmuch-address-internal-completion '(received nil)) | ||
49 | (setq notmuch-always-prompt-for-sender t) | ||
50 | (setq notmuch-command "notmuch-ssh") | ||
51 | (setq notmuch-crypto-process-mime t) | ||
52 | (setq notmuch-draft-tags '("+draft" "-inbox")) | ||
53 | (setq notmuch-fcc-dirs nil) | ||
54 | (setq notmuch-hello-sections '(notmuch-hello-insert-header notmuch-hello-insert-saved-searches)) | ||
55 | (setq notmuch-hello-thousands-separator " ") | ||
56 | (setq notmuch-identities '("gkleen@yggdrasil.li" "g@141.li" "kleen@cip.ifi.lmu.de" "Gregor.Kleen@stud.ifi.lmu.de" "G.Kleen@campus.lmu.de" "G.Kleen@lmu.de" "gregor.kleen@ifi.lmu.de" "uni2work@ifi.lmu.de" "gregor@kleen.li")) | ||
57 | (setq notmuch-message-headers '("Subject" "To" "Cc" "Date")) | ||
58 | (setq notmuch-message-replied-tags '("+replied" "-unread" "-inbox")) | ||
59 | (setq notmuch-saved-searches | ||
60 | (quote | ||
61 | ((:name "inbox" :query "tag:inbox" :key "i") | ||
62 | (:name "unread" :query "tag:unread AND tag:inbox" :key "u") | ||
63 | (:name "drafts" :query "tag:draft" :key "d") | ||
64 | (:name "all mail" :query "date:month.." :key "a" :count-query "*") | ||
65 | (:name "sent" :query "is:sent" :key "s" :count-query "is:sent") | ||
66 | ))) | ||
67 | (setq notmuch-search-oldest-first nil) | ||
68 | (setq notmuch-show-all-tags-list t) | ||
69 | (setq notmuch-show-logo nil) | ||
70 | |||
71 | (setq send-mail-function 'sendmail-send-it) | ||
72 | (setq mail-envelope-from 'header) | ||
73 | (setq mail-specify-envelope-from 't) | ||
74 | (setq mail-default-headers nil) | ||
75 | (setq message-default-headers "") | ||
76 | (setq message-default-mail-headers "") | ||
77 | (setq message-sendmail-envelope-from 'header) | ||
78 | |||
79 | (setq highlight-symbol-idle-delay 0) | ||
80 | |||
81 | (setq indent-tabs-mode nil) | ||
82 | |||
83 | (setq ido-enable-flex-matching t) | ||
84 | (setq ido-everywhere t) | ||
85 | (ido-mode 1) | ||
86 | |||
87 | (setq mail-host-address "sif.midgard.yggdrasil") | ||
88 | (setq user-full-name "Gregor Kleen") | ||
89 | |||
90 | (defun tell-emacsclients-for-buffer-to-die () | ||
91 | "Sends error exit command to every client for the current buffer." | ||
92 | (interactive) | ||
93 | (dolist (proc server-buffer-clients) | ||
94 | (server-send-string proc "-error die"))) | ||
95 | |||
96 | (defun kill-buffer-with-special-emacsclient-handling () | ||
97 | "Wrapper around kill-buffer that ensures tell-emacsclients-for-buffer-to-die is on the hooks" | ||
98 | (interactive) | ||
99 | (add-hook 'kill-buffer-hook 'tell-emacsclients-for-buffer-to-die nil t) | ||
100 | (kill-buffer)) | ||
101 | |||
102 | ;; (global-set-key (kbd "C-x k") 'kill-buffer) | ||
103 | |||
104 | (defun install-emacsclient-wrapped-kill-buffer () | ||
105 | "Installs wrapped kill-buffer with special emacsclient handling. | ||
106 | Best not to install it unconditionally because the server is not | ||
107 | necessarily running." | ||
108 | (interactive) | ||
109 | (global-set-key (kbd "C-x k") 'kill-buffer-with-special-emacsclient-handling)) | ||
110 | |||
111 | (add-hook 'server-switch-hook 'install-emacsclient-wrapped-kill-buffer) | ||