]> git.friedersdorff.com Git - max/dotfiles.git/blob - emacs/.emacs
Use twmn to notify for email messages
[max/dotfiles.git] / emacs / .emacs
1 (require 'package)
2 (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
3 (package-initialize)
4 (custom-set-variables
5  ;; custom-set-variables was added by Custom.
6  ;; If you edit it by hand, you could mess it up, so be careful.
7  ;; Your init file should contain only one such instance.
8  ;; If there is more than one, they won't work right.
9  '(ansi-color-faces-vector
10    [default default default italic underline success warning error])
11  '(ansi-color-names-vector
12    ["#212526" "#ff4b4b" "#b4fa70" "#fce94f" "#729fcf" "#e090d7" "#8cc4ff" "#eeeeec"])
13  '(auto-save-file-name-transforms (quote ((".*" "~/.emacs.d/autosaves/\\1" t))))
14  '(backup-directory-alist (quote ((".*" . "~/.emacs.d/backups/"))))
15  '(custom-enabled-themes (quote (molokai)))
16  '(custom-safe-themes
17    (quote
18     ("4e753673a37c71b07e3026be75dc6af3efbac5ce335f3707b7d6a110ecb636a3" "b571f92c9bfaf4a28cb64ae4b4cdbda95241cd62cf07d942be44dc8f46c491f4" default)))
19  '(fci-rule-color "#383838")
20  '(nrepl-message-colors
21    (quote
22     ("#CC9393" "#DFAF8F" "#F0DFAF" "#7F9F7F" "#BFEBBF" "#93E0E3" "#94BFF3" "#DC8CC3")))
23  '(package-selected-packages
24    (quote
25     (yaml-mode minimap js2-mode editorconfig wanderlust evil-magit evil-leader evil-org molokai-theme org-evil flycheck-mypy jinja2 jinja2-mode highlight-indent-guides projectile helm-projectile zenburn-theme helm helm-config use-package flycheck company-jedi company org evil)))
26  '(pdf-view-midnight-colors (quote ("#DCDCCC" . "#383838")))
27  '(vc-annotate-background "#2B2B2B")
28  '(vc-annotate-color-map
29    (quote
30     ((20 . "#BC8383")
31      (40 . "#CC9393")
32      (60 . "#DFAF8F")
33      (80 . "#D0BF8F")
34      (100 . "#E0CF9F")
35      (120 . "#F0DFAF")
36      (140 . "#5F7F5F")
37      (160 . "#7F9F7F")
38      (180 . "#8FB28F")
39      (200 . "#9FC59F")
40      (220 . "#AFD8AF")
41      (240 . "#BFEBBF")
42      (260 . "#93E0E3")
43      (280 . "#6CA0A3")
44      (300 . "#7CB8BB")
45      (320 . "#8CD0D3")
46      (340 . "#94BFF3")
47      (360 . "#DC8CC3"))) t)
48  '(vc-annotate-very-old-color "#DC8CC3"))
49 (custom-set-faces
50  ;; custom-set-faces was added by Custom.
51  ;; If you edit it by hand, you could mess it up, so be careful.
52  ;; Your init file should contain only one such instance.
53  ;; If there is more than one, they won't work right.
54  )
55
56 ;; Create autosave dir
57 (make-directory "~/.emacs.d/autosaves/" t)
58
59 (use-package evil
60   :init
61   (setq evil-want-C-i-jump nil)
62   :ensure t
63   :config (evil-mode 1))
64
65 (use-package org
66   :ensure t)
67
68 (use-package org-evil
69   :ensure t)
70
71 (use-package flycheck
72   :ensure t
73   :init (global-flycheck-mode))
74
75 (use-package flycheck-mypy
76   :ensure t)
77
78 (use-package helm-config
79   :ensure helm
80   :config
81   (helm-mode 1)
82   (global-set-key (kbd "M-x") 'helm-M-x))
83
84 (use-package projectile
85   :ensure t)
86
87 (use-package helm-projectile
88   :ensure t
89   :config
90   (projectile-global-mode)
91   (setq projectile-completion-system 'helm)
92   (helm-projectile-on))
93
94 (use-package highlight-indent-guides
95   :ensure t
96   :config
97   (add-hook 'prog-mode-hook 'highlight-indent-guides-mode)
98   (setq highlight-indent-guides-method 'character)
99   (setq highlight-indent-guides-character ?\|)
100   (set-face-foreground 'highlight-indent-guides-character-face "darkgray"))
101
102 (use-package jinja2-mode
103   :ensure t)
104
105 (use-package whitespace
106   :config
107   (setq whitespace-style '(face lines))
108   (setq whitespace-line-column 80)
109   (global-whitespace-mode +1))
110
111 (use-package magit
112   :ensure t
113   :config
114   (global-set-key (kbd "C-x g") 'magit-status))
115
116 (use-package evil-magit
117   :ensure t)
118
119 (use-package editorconfig
120   :ensure t
121   :init
122   (add-hook 'prog-mode-hook (editorconfig-mode 1))
123   (add-hook 'text-mode-hook (editorconfig-mode 1)))
124
125 (use-package js2-mode
126   :ensure t
127   :config
128   (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
129   (setq js2-strict-missing-semi-warning nil))
130
131 (use-package yaml-mode
132   :ensure t)
133
134 (use-package mu4e
135   :config
136   (setq
137    mu4e-maildir "~/mail"
138    mu4e-get-mail-command
139    (concat "/usr/bin/mbsync -c /home/max/.mbsync/personal.mbsync -a &&"
140            "/usr/bin/mbsync -c /home/max/.mbsync/personal-gmail.mbsync -a &&"
141            "/usr/bin/mbsync -c /home/max/.mbsync/aber.mbsync -a")
142    mu4e-update-interval 60)
143   ; Force mu4e to rename file on moving
144   (setq mu4e-change-filenames-when-moving t)
145   (setq
146    message-send-mail-function 'smtpmail-send-it
147    smtpmail-default-smtp-server "mail.friedersdorff.com"
148    smtpmail-auth-credentials (expand-file-name "~/.authinfo.gpg"))
149   (setq mu4e-contexts
150         `( , (make-mu4e-context
151               :name "Personal"
152               :enter-func (lambda () (mu4e-message "Switch to Peronal context"))
153               :match-func (lambda (msg)
154                             (when msg
155                               (mu4e-message-contact-field-matches
156                                msg (list :to :cc :bcc)
157                                "max\\+?.*@frie\\(dersdorff\\)?.com")))
158               :vars '((user-mail-address . "max@friedersdorff.com")
159                       (user-full-name . "Maximilian Friedersdorff")
160                       (mu4e-sent-folder . "/personal/Sent")
161                       (mu4e-drafts-folder . "/personal/Drafts")
162                       (mu4e-trash-folder . "/personal/Trash")
163                       (smtpmail-smtp-server . "mail.friedersdorff.com")
164                       (smtpmail-smtp-service . 587))),
165             (make-mu4e-context
166              :name "Gmail"
167              :enter-func (lambda () (mu4e-message "Switch to Gmail context"))
168              :match-func (lambda (msg)
169                            (when msg
170                              (mu4e-message-contact-field-matches
171                               msg (list :to :cc :bcc)
172                               "maxf130\\+?.*@gmail.com")))
173              :vars '((user-mail-address . "maxf130@gmail.com")
174                      (user-full-name . "Maximilian Friedersdorff")
175                      (mu4e-sent-folder . "/personal-gmail/Sent")
176                      (mu4e-sent-messages-behaviour . 'delete)
177                      (mu4e-drafts-folder . "/personal-gmail/Drafts")
178                      (smtpmail-smtp-server . "smtp.gmail.com")
179                      (smtpmail-smtp-service . 587))),
180             (make-mu4e-context
181              :name "Aber"
182              :enter-func (lambda () (mu4e-message "Switch to Aber context"))
183              :match-func (lambda (msg)
184                            (when msg
185                              (mu4e-message-contact-field-matches
186                               msg (list :to :cc :bcc)
187                               "maf54\\+?.*@aber.ac.uk")))
188              :vars '((user-mail-address . "maf54@aber.ac.uk")
189                      (user-full-name . "Maximilian Friedersdorff")
190                      (mu4e-sent-folder . "/aber/Sent")
191                      (mu4e-drafts-folder . "/aber/Drafts")
192                      (mu4e-trash-folder . "/aber/Trash")
193                      (smtpmail-smtp-server . "smtp.office365.com")
194                      (smtpmail-smtp-service . 587))))
195
196         mu4e-context-policy 'pick-first)
197   (setq mu4e-html2text-command "lynx -stdin -dump -force_html"))
198 (use-package mu4e-alert
199   :ensure t
200   :config
201   (setq mu4e-alert-interesting-mail-query
202         (concatenate
203          'string
204          "flag:unread "
205          "AND ( "
206          "maildir:/personal/Inbox OR "
207          "maildir:/personal/slackware OR "
208          "maildir:/personal-gmail/Inbox OR "
209          "maildir:/aber/Inbox "
210          ")"))
211   (mu4e-alert-set-default-style 'notifications)
212   (add-hook 'after-init-hook #'mu4e-alert-enable-notifications))
213
214
215 ;;;(global-company-mode)
216 ;;;(add-hook 'after-init-hook 'global-company-mode)
217
218 (add-hook 'prog-mode-hook 'electric-pair-mode)
219
220 (eval-after-load 'company
221   '(add-to-list 'company-backends 'company-jedi))