doom-emacs/.config/doom/config.el (view raw)
1;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
2
3;; Place your private configuration here! Remember, you do not need to run 'doom
4;; sync' after modifying this file!
5
6
7;; Some functionality uses this to identify you, e.g. GPG configuration, email
8;; clients, file templates and snippets.
9;;
10(setq user-full-name "la-ninpre")
11(setq user-mail-address "leobrekalini@gmail.com")
12
13;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
14;; are the three important ones:
15;;
16;; + `doom-font'
17;; + `doom-variable-pitch-font'
18;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
19;; presentations or streaming.
20;;
21;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
22;; font string. You generally only need these two:
23;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light)
24;; doom-variable-pitch-font (font-spec :family "sans" :size 13))
25
26;; There are two ways to load a theme. Both assume the theme is installed and
27;; available. You can either set `doom-theme' or manually load a theme with the
28;; `load-theme' function. This is the default:
29
30(setq doom-theme 'la-ninpre)
31
32(setq doom-font (font-spec :family "JetBrains Mono" :size 14 :weight 'medium :style 'medium)
33 doom-big-font (font-spec :family "JetBrains Mono" :size 36 :weight 'medium)
34 doom-unicode-font (font-spec :family "Noto")
35 doom-serif-font (font-spec :family "Noto Serif")
36 doom-variable-pitch-font (font-spec :family "Lato" :size 14))
37
38;; If you use `org' and don't want your org files in the default location below,
39;; change `org-directory'. It must be set before org loads!
40(setq org-directory "~/Documents/org/")
41
42;; This determines the style of line numbers in effect. If set to `nil', line
43;; numbers are disabled. For relative line numbers, set this to `relative'.
44(setq display-line-numbers-type 'relative)
45
46;; disable exit prompt
47(setq confirm-kill-emacs nil)
48
49;; fix path for pandoc
50(add-to-list 'exec-path "~/.local/bin")
51
52;; mu4e
53(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e")
54(require 'mu4e)
55
56(setq mu4e-change-filenames-when-moving t)
57(setq message-send-mail-function 'smtpmail-send-it)
58(setq mu4e-get-mail-command "mbsync -c ~/.config/mbsyncrc -a"
59 mu4e-update-interval 300
60 mu4e-sent-messages-behavior 'delete
61 mu4e-attachment-dir "~/Downloads"
62 message-send-mail-function 'smtpmail-send-it
63 starttls-use-gnutls t
64 mu4e-compose-format-flowed t)
65
66(setq mu4e-context-policy 'pick-first)
67(setq mu4e-compose-context-policy 'ask-if-none)
68
69(add-to-list 'load-path "~/.config/doom")
70(require 'la-ninpre-email)
71;; actual `mu4e-contexts' is in =~/.config/doom/la-ninpre-email.el=.
72;; i don't want to include it, but it looks very similar to this below.
73;; also there's an example `mbsyncrc' in =~/.config/mbsyncrc-example=
74
75;; (setq mu4e-contexts
76;; (list
77;; (make-mu4e-context
78;; :name "acct-1"
79;; :enter-func (lambda () (mu4e-message "Entering context acct-1"))
80;; :leave-func (lambda () (mu4e-message "Leaving context acct-1"))
81;; :match-func (lambda (msg)
82;; (when msg
83;; (mu4e-message-contact-field-matches
84;; msg '(:from :to :cc :bcc) "acct-1@example.com")))
85;; :vars '((user-mail-address . "acct-1@example.com")
86;; (user-full-name . "acct-1")
87;; (mu4e-sent-folder . "/acct-1/Sent")
88;; (mu4e-drafts-folder . "/acct-1/Drafts")
89;; (mu4e-trash-folder . "/acct-1/Trash")
90;; (smtpmail-smtp-user . "acct-1@example.com")
91;; (smtpmail-starttls-credentials . (("smtp.example.com" 587 nil nil)))
92;; (smtpmail-auth-credentials
93;; . (expand-file-name "~/.password-store/acct-1.gpg"))
94;; (smtpmail-default-smtp-server . "smtp.example.com")
95;; (smtpmail-smtp-server . "smtp.example.com")
96;; (smtpmail-smtp-service . 587)
97;; (smtpmail-debug-info . t)
98;; (smtpmail-debug-verbose . t)
99;; (mu4e-maildir-shortcuts . (("/acct-1/INBOX" . ?i)
100;; ("/acct-1/Sent" . ?s)
101;; ("/acct-1/Trash" . ?t)
102;; ("/acct-1/All Mail" . ?a)
103;; ("/acct-1/Starred" . ?r)
104;; ("/acct-1/drafts" . ?d)
105;; ))))
106;; (make-mu4e-context
107;; :name "acct-2"
108;; :enter-func (lambda () (mu4e-message "Entering context acct-2"))
109;; :leave-func (lambda () (mu4e-message "Leaving context acct-2"))
110;; :match-func (lambda (msg)
111;; (when msg
112;; (mu4e-message-contact-field-matches
113;; msg '(:from :to :cc :bcc) "acct-2@example.com")))
114;; :vars '((user-mail-address . "acct-2@example.com")
115;; (user-full-name . "acct-2")
116;; (mu4e-sent-folder . "/acct-2/[Gmail].Sent Mail")
117;; (mu4e-drafts-folder . "/acct-2/[Gmail].Drafts")
118;; (mu4e-trash-folder . "/acct-2/[Gmail].Bin")
119;; (smtpmail-smtp-user . "acct-2@example.com")
120;; (smtpmail-starttls-credentials . (("smtp.gmail.com" 587 nil nil)))
121;; (smtpmail-auth-credentials
122;; . (expand-file-name "~/.password-store/self/acct-2.gpg"))
123;; (smtpmail-default-smtp-server . "smtp.gmail.com")
124;; (smtpmail-smtp-server . "smtp.gmail.com")
125;; (smtpmail-smtp-service . 587)
126;; (smtpmail-debug-info . t)
127;; (smtpmail-debug-verbose . t)
128;; (mu4e-maildir-shortcuts . (("/acct-2/INBOX" . ?i)
129;; ("/acct-2/[Gmail].Sent Mail" . ?s)
130;; ("/acct-2/[Gmail].Bin" . ?t)
131;; ("/acct-2/[Gmail].All Mail" . ?a)
132;; ("/acct-2/[Gmail].Starred" . ?r)
133;; ("/acct-2/[Gmail].drafts" . ?d)
134;; ))))))
135;; (provide 'la-ninpre-email)
136
137
138(setq mml-secure-openpgp-signers '("DD1F79DC24054C1F42440F2E405C2C163EF6A2C9"))
139
140(add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)
141
142;; dired
143
144(setq dired-listing-switches "-la --group-directories-first")
145
146(defun xah-syntax-color-hex ()
147 "syntax color text of the form `#ff1100' and #abc in current buffer.
148url `http://ergoemacs.org/emacs/emacs_CSS_colors.html'
149version 2017-03-12"
150 (interactive)
151 (font-lock-add-keywords
152 nil
153 '(("#[[:xdigit:]]\\{3\\}"
154 (0 (put-text-property
155 (match-beginning 0)
156 (match-end 0)
157 'face (list :background
158 (let* (
159 (ms (match-string-no-properties 0))
160 (r (substring ms 1 2))
161 (g (substring ms 2 3))
162 (b (substring ms 3 4)))
163 (concat "#" r r g g b b))))))
164 ("#[[:xdigit:]]\\{6\\}"
165 (0 (put-text-property
166 (match-beginning 0)
167 (match-end 0)
168 'face (list :background (match-string-no-properties 0)))))))
169 (font-lock-flush))
170
171(add-hook 'emacs-lisp-mode 'xah-syntax-color-hex)
172(add-hook 'css-mode-hook 'xah-syntax-color-hex)
173(add-hook 'yaml-mode-hook 'xah-syntax-color-hex)
174(add-hook 'html-mode-hook 'xah-syntax-color-hex)
175
176(add-hook 'c++-mode-hook 'irony-mode)
177(add-hook 'c-mode-hook 'irony-mode)
178
179(require 'rtags)
180(cmake-ide-setup)
181
182;; Here are some additional functions/macros that could help you configure Doom:
183;;
184;; - `load!' for loading external *.el files relative to this one
185;; - `use-package!' for configuring packages
186;; - `after!' for running code after a package has loaded
187;; - `add-load-path!' for adding directories to the `load-path', relative to
188;; this file. Emacs searches the `load-path' when you load packages with
189;; `require' or `use-package'.
190;; - `map!' for binding new keys
191;;
192;; To get information about any of these functions/macros, move the cursor over
193;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
194;; This will open documentation for it, including demos of how they are used.
195;;
196;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
197;; they are implemented.