summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/emacs.el
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2021-01-03 00:55:29 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2021-01-03 16:21:34 +0100
commit4a3d2a8ddaf4e546df360656bc54b2947bdb890b (patch)
treef571511e0b74fbd7e78f7e10966a8d6d5d400241 /accounts/gkleen@sif/emacs.el
parent3b5ab82fa714a0d483a7b90d60f9f7c857646e33 (diff)
downloadnixos-4a3d2a8ddaf4e546df360656bc54b2947bdb890b.tar
nixos-4a3d2a8ddaf4e546df360656bc54b2947bdb890b.tar.gz
nixos-4a3d2a8ddaf4e546df360656bc54b2947bdb890b.tar.bz2
nixos-4a3d2a8ddaf4e546df360656bc54b2947bdb890b.tar.xz
nixos-4a3d2a8ddaf4e546df360656bc54b2947bdb890b.zip
gkleen@sif: import
Diffstat (limited to 'accounts/gkleen@sif/emacs.el')
-rw-r--r--accounts/gkleen@sif/emacs.el99
1 files changed, 99 insertions, 0 deletions
diff --git a/accounts/gkleen@sif/emacs.el b/accounts/gkleen@sif/emacs.el
new file mode 100644
index 00000000..7bfd5c18
--- /dev/null
+++ b/accounts/gkleen@sif/emacs.el
@@ -0,0 +1,99 @@
1(menu-bar-mode -1)
2(scroll-bar-mode -1)
3(tool-bar-mode -1)
4
5(set-face-attribute 'default nil :height 50)
6
7(require 'evil)
8(evil-mode 1)
9
10(global-subword-mode)
11(global-undo-tree-mode)
12
13(global-set-key (kbd "RET") 'newline-and-indent)
14(global-set-key (kbd "M-g") 'magit-status)
15(global-set-key (kbd "M-?") 'vc-git-grep)
16
17(setq backup-directory-alist `(("." . "~/.saves")))
18(setq delete-old-versions t
19 kept-new-versions 6
20 kept-old-versions 2
21 version-control t)
22
23(add-hook 'haskell-mode-hook 'haskell-indentation-mode)
24(add-hook 'haskell-mode-hook 'subword-mode)
25(add-hook 'haskell-mode-hook 'highlight-symbol-mode)
26(add-hook 'haskell-mode-hook 'highlight-paretheses-mode)
27
28(add-hook 'js-mode-hook 'highlight-symbol-mode)
29(add-hook 'js-mode-hook 'highlight-parentheses-mode)
30(defun my-js-mode-hook ()
31 "Custom `js-mode' behaviours."
32 (setq js-indent-level 2)
33 )
34(add-hook 'js-mode-hook 'my-js-mode-hook)
35
36(setq notmuch-address-internal-completion '(received nil))
37(setq notmuch-always-prompt-for-sender t)
38(setq notmuch-command "notmuch-ssh")
39(setq notmuch-crypto-process-mime t)
40(setq notmuch-draft-tags '("+draft" "-inbox"))
41(setq notmuch-fcc-dirs nil)
42(setq notmuch-hello-sections '(notmuch-hello-insert-header notmuch-hello-insert-saved-searches))
43(setq notmuch-hello-thousands-separator " ")
44(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"))
45(setq notmuch-message-headers '("Subject" "To" "Cc" "Date"))
46(setq notmuch-message-replied-tags '("+replied" "-unread" "-inbox"))
47(setq notmuch-saved-searches
48 (quote
49 ((:name "inbox" :query "tag:inbox" :key "i")
50 (:name "unread" :query "tag:unread AND tag:inbox" :key "u")
51 (:name "drafts" :query "tag:draft" :key "d")
52 (:name "all mail" :query "date:month.." :key "a" :count-query "*")
53 (:name "sent" :query "is:sent" :key "s" :count-query "is:sent")
54 )))
55(setq notmuch-search-oldest-first nil)
56(setq notmuch-show-all-tags-list t)
57(setq notmuch-show-logo nil)
58
59(setq send-mail-function 'sendmail-send-it)
60(setq mail-envelope-from 'header)
61(setq mail-specify-envelope-from 't)
62(setq mail-default-headers nil)
63(setq message-default-headers "")
64(setq message-default-mail-headers "")
65(setq message-sendmail-envelope-from 'header)
66
67(setq highlight-symbol-idle-delay 0)
68
69(setq indent-tabs-mode nil)
70
71(setq ido-enable-flex-matching t)
72(setq ido-everywhere t)
73(ido-mode 1)
74
75(setq mail-host-address "sif.midgard.yggdrasil")
76(setq user-full-name "Gregor Kleen")
77
78(defun tell-emacsclients-for-buffer-to-die ()
79 "Sends error exit command to every client for the current buffer."
80 (interactive)
81 (dolist (proc server-buffer-clients)
82 (server-send-string proc "-error die")))
83
84(defun kill-buffer-with-special-emacsclient-handling ()
85 "Wrapper around kill-buffer that ensures tell-emacsclients-for-buffer-to-die is on the hooks"
86 (interactive)
87 (add-hook 'kill-buffer-hook 'tell-emacsclients-for-buffer-to-die nil t)
88 (kill-buffer))
89
90;; (global-set-key (kbd "C-x k") 'kill-buffer)
91
92(defun install-emacsclient-wrapped-kill-buffer ()
93 "Installs wrapped kill-buffer with special emacsclient handling.
94Best not to install it unconditionally because the server is not
95necessarily running."
96 (interactive)
97 (global-set-key (kbd "C-x k") 'kill-buffer-with-special-emacsclient-handling))
98
99(add-hook 'server-switch-hook 'install-emacsclient-wrapped-kill-buffer)