diff options
-rw-r--r-- | init.el | 171 |
1 files changed, 109 insertions, 62 deletions
diff --git a/init.el b/init.el index e2f8c42..ebf6f1e 100644 --- a/init.el +++ b/init.el | |||
@@ -51,24 +51,36 @@ | |||
51 | (global-visual-line-mode 1) | 51 | (global-visual-line-mode 1) |
52 | 52 | ||
53 | (display-time-mode 1) | 53 | (display-time-mode 1) |
54 | (setq display-time-format "%R") | ||
54 | 55 | ||
55 | (add-hook 'before-save-hook #'delete-trailing-whitespace) | 56 | (add-hook 'before-save-hook #'delete-trailing-whitespace) |
56 | (add-hook 'prog-mode-hook (lambda () | 57 | (add-hook 'prog-mode-hook |
57 | (if (and (fboundp 'display-line-numbers-mode) | 58 | (if (and (fboundp 'display-line-numbers-mode) |
58 | (display-graphic-p)) | 59 | (display-graphic-p)) |
59 | #'display-line-numbers-mode | 60 | #'display-line-numbers-mode |
60 | #'linum-mode))) | 61 | #'linum-mode)) |
62 | |||
63 | (setq uniquify-buffer-name-style 'forward) | ||
61 | 64 | ||
62 | (set-face-attribute 'default nil :font "GoMono Nerd Font-11") | 65 | (set-face-attribute 'default nil :font "GoMono Nerd Font-11") |
63 | 66 | ||
64 | ;;; packages | 67 | (mouse-avoidance-mode 'jump) |
68 | |||
69 | ;;; Packages | ||
70 | |||
71 | (use-package aggressive-indent | ||
72 | :hook | ||
73 | (prog-mode . aggressive-indent-mode)) | ||
74 | |||
75 | (use-package async | ||
76 | :init (dired-async-mode 1)) | ||
65 | 77 | ||
66 | ;; exwm | 78 | ;; exwm |
67 | (use-package exwm | 79 | (use-package exwm |
68 | :demand | 80 | :demand |
69 | :custom | 81 | :custom |
70 | (exwm-layout-show-all-buffers t) | 82 | (exwm-layout-show-all-buffers t) |
71 | (mouse-autoselect-window t) | 83 | ;;(mouse-autoselect-window t) |
72 | (exwm-workspace-number 4) | 84 | (exwm-workspace-number 4) |
73 | (exwm-input-global-keys | 85 | (exwm-input-global-keys |
74 | `( | 86 | `( |
@@ -108,6 +120,7 @@ | |||
108 | (lambda () "Update workspace name to window title" | 120 | (lambda () "Update workspace name to window title" |
109 | (when (not exwm-instance-name) | 121 | (when (not exwm-instance-name) |
110 | (exwm-workspace-rename-buffer exwm-title)))) | 122 | (exwm-workspace-rename-buffer exwm-title)))) |
123 | (exwm-init . window-divider-mode) | ||
111 | (exwm-init . | 124 | (exwm-init . |
112 | (lambda () "Autostart" | 125 | (lambda () "Autostart" |
113 | (start-process-shell-command "cmst" nil "cmst -m -w 5") | 126 | (start-process-shell-command "cmst" nil "cmst -m -w 5") |
@@ -122,33 +135,29 @@ | |||
122 | (require 'exwm-systemtray) | 135 | (require 'exwm-systemtray) |
123 | (exwm-systemtray-enable)) | 136 | (exwm-systemtray-enable)) |
124 | 137 | ||
125 | (use-package exwm-firefox-core | 138 | ;; (use-package exwm-firefox-core |
126 | :after exwm | 139 | ;; :after exwm |
127 | :straight (exwm-firefox-core | 140 | ;; :straight (exwm-firefox-core |
128 | :type git | 141 | ;; :type git |
129 | :host github | 142 | ;; :host github |
130 | :repo "walseb/exwm-firefox-core")) | 143 | ;; :repo "walseb/exwm-firefox-core")) |
131 | 144 | ||
132 | (use-package exwm-firefox | 145 | ;; (use-package exwm-firefox |
133 | :after exwm-firefox-core | 146 | ;; :after exwm-firefox-core |
134 | :straight (exwm-firefox | 147 | ;; :straight (exwm-firefox |
135 | :type git | 148 | ;; :type git |
136 | :host github | 149 | ;; :host github |
137 | :repo "ieure/exwm-firefox") | 150 | ;; :repo "ieure/exwm-firefox") |
138 | :config | ||
139 | (exwm-firefox-mode)) | ||
140 | |||
141 | ;; (use-package mini-modeline | ||
142 | ;; :quelpa (mini-modeline | ||
143 | ;; :repo "kiennq/emacs-mini-modeline" | ||
144 | ;; :fetcher github) | ||
145 | ;; :custom | ||
146 | ;; (mini-modeline-enhance-viusual t) | ||
147 | ;; (mini-modeline-display-gui-line t) | ||
148 | ;; (mini-modeline-right-padding 7) ;; characters -- for systemtray | ||
149 | ;; (mini-modeline-face-attr nil) | ||
150 | ;; :config | 151 | ;; :config |
151 | ;; (mini-modeline-mode t)) | 152 | ;; (exwm-firefox-mode)) |
153 | |||
154 | (setq browse-url-browser-function 'browse-url-generic | ||
155 | browse-url-generic-program "firefox") | ||
156 | |||
157 | (use-package exwm-mff | ||
158 | :after exwm | ||
159 | :hook | ||
160 | (exwm-init . exwm-mff-mode)) | ||
152 | 161 | ||
153 | (use-package desktop-environment | 162 | (use-package desktop-environment |
154 | :hook (exwm-init . desktop-environment-mode) | 163 | :hook (exwm-init . desktop-environment-mode) |
@@ -176,9 +185,24 @@ | |||
176 | 185 | ||
177 | (use-package switch-window | 186 | (use-package switch-window |
178 | :custom | 187 | :custom |
179 | (switch-window-shortcut-style 'qwerty) | 188 | (switch-window-shortcut-style 'qwerty) |
180 | :bind | 189 | :bind |
181 | ("M-o" . switch-window)) | 190 | ([remap other-window] . switch-window) |
191 | ("s-o" . switch-window)) | ||
192 | |||
193 | (defun split-and-follow-below () | ||
194 | (interactive) | ||
195 | (split-window-below) | ||
196 | (balance-windows) | ||
197 | (other-window 1)) | ||
198 | (global-set-key [remap split-window-below] 'split-and-follow-below) | ||
199 | |||
200 | (defun split-and-follow-right () | ||
201 | (interactive) | ||
202 | (split-window-right) | ||
203 | (balance-windows) | ||
204 | (other-window 1)) | ||
205 | (global-set-key [remap split-window-right] 'split-and-follow-right) | ||
182 | 206 | ||
183 | ;; modeline | 207 | ;; modeline |
184 | (use-package doom-modeline | 208 | (use-package doom-modeline |
@@ -264,42 +288,40 @@ | |||
264 | 288 | ||
265 | (use-package magit | 289 | (use-package magit |
266 | :bind | 290 | :bind |
267 | ("M-g" . magit)) | 291 | ("M-x g" . magit)) |
268 | 292 | ||
269 | ;; mu4e | 293 | ;; mu4e |
270 | (use-package mu4e | 294 | (progn |
271 | :straight (mu4e | 295 | (require 'mu4e) |
272 | :host github | 296 | (require 'mu4e-contrib) |
273 | :repo "emacsmirror/mu4e" | ||
274 | :files (:defaults "mu4e/*.el")) | ||
275 | :init | ||
276 | (require 'smtpmail-async) | 297 | (require 'smtpmail-async) |
277 | :custom | 298 | (setq mu4e-headers-skip-duplicates t) |
278 | (mu4e-headers-skip-duplicates t) | 299 | (setq mu4e-view-show-images t) |
279 | (mu4e-view-show-images t) | 300 | (setq mu4e-view-show-addresses t) |
280 | (mu4e-view-show-addresses t) | 301 | (setq mu4e-compose-format-flowed t) |
281 | (mu4e-compose-format-flowed t) | 302 | (setq mu4e-date-format "%Y-%m-%d") |
282 | (mu4e-date-format "%Y-%m-%d") | 303 | (setq mu4e-headers-date-format "%Y-%m-%d") |
283 | (mu4e-headers-date-format "%Y-%m-%d") | 304 | (setq mu4e-change-filenames-when-moving t) |
284 | (mu4e-change-filenames-when-moving t) | 305 | (setq mu4e-attachments-dir "~/Downloads") |
285 | (mu4e-attachments-dir "~/Downloads") | 306 | (setq message-kill-buffer-on-exit t) |
286 | (message-kill-buffer-on-exit t) | 307 | (setq mu4e-update-interval (* 60 60)) |
287 | (mu4e-update-interval (* 60 60)) | 308 | (setq mu4e-maildir "~/Mail/fastmail") |
288 | (mu4e-maildir "~/Mail/fastmail") | 309 | (setq mu4e-refile-folder "/Archive") |
289 | (mu4e-refile-folder "/Archive") | 310 | (setq mu4e-sent-folder "/Sent") |
290 | (mu4e-sent-folder "/Sent") | 311 | (setq mu4e-drafts-folder "/Drafts") |
291 | (mu4e-drafts-folder "/Drafts") | 312 | (setq mu4e-trash-folder "/Trash") |
292 | (mu4e-trash-folder "/Trash") | 313 | (setq message-send-mail-function 'async-smtpmail-send-it) |
293 | (message-send-mail-function 'async-smtpmail-send-it) | 314 | (setq smtpmail-default-smtp-server "smtp.fastmail.com") |
294 | (smtpmail-default-smtp-server "smtp.fastmail.com") | 315 | (setq smtpmail-smtp-server "smtp.fastmail.com") |
295 | (smtpmail-smtp-server "smtp.fastmail.com") | 316 | (setq smtpmail-smtp-service 465) |
296 | (smtpmail-smtp-service 465) | 317 | (setq smtpmail-stream-type 'ssl) |
297 | (smtpmail-stream-type 'ssl) | ||
298 | :config | ||
299 | (fset 'my-move-to-trash "mTrash") | 318 | (fset 'my-move-to-trash "mTrash") |
300 | (define-key mu4e-headers-mode-map (kbd "d") 'my-move-to-trash) | 319 | (define-key mu4e-headers-mode-map (kbd "d") 'my-move-to-trash) |
301 | (define-key mu4e-view-mode-map (kbd "d") 'my-move-to-trash)) | 320 | (define-key mu4e-view-mode-map (kbd "d") 'my-move-to-trash)) |
302 | 321 | ||
322 | ;; tramp | ||
323 | (setq tramp-terminal-type "tramp") | ||
324 | |||
303 | ;; try packages out | 325 | ;; try packages out |
304 | ;(use-package try) | 326 | ;(use-package try) |
305 | 327 | ||
@@ -331,3 +353,28 @@ | |||
331 | :straight | 353 | :straight |
332 | (gemini-write | 354 | (gemini-write |
333 | :repo "https://alexschroeder.ch/cgit/gemini-write")) | 355 | :repo "https://alexschroeder.ch/cgit/gemini-write")) |
356 | |||
357 | ;;; better help messages | ||
358 | (use-package helpful | ||
359 | :bind | ||
360 | ("C-h f" . helpful-callable) | ||
361 | ("C-h v" . helpful-variable) | ||
362 | ("C-h k" . helpful-key) | ||
363 | ("C-c C-d" . helpful-at-point) | ||
364 | ("C-h F" . helpful-function) | ||
365 | ("C-h C" . helpful-command) | ||
366 | :custom | ||
367 | (counsel-describe-function-function #'helpful-callable) | ||
368 | (counsel-describe-variable-function #'helpful-variable)) | ||
369 | |||
370 | ;;; eshell | ||
371 | ;; ~ much from http://www.howardism.org/Technical/Emacs/eshell-fun.html | ||
372 | ;;; TODO | ||
373 | |||
374 | (use-package avy | ||
375 | :bind | ||
376 | ("M-s" . avy-goto-char)) | ||
377 | |||
378 | (use-package rainbow-mode | ||
379 | :hook | ||
380 | (prog-mode . rainbow-mode)) | ||