summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el710
1 files changed, 320 insertions, 390 deletions
diff --git a/init.el b/init.el index 6010297..f5a9bbd 100644 --- a/init.el +++ b/init.el
@@ -6,60 +6,177 @@
6;; which pointed out that I could use `outline-mode' (or in my case, 6;; which pointed out that I could use `outline-mode' (or in my case,
7;; `outshine') to fold and navigate a pure-elisp `init.el'. So that's 7;; `outshine') to fold and navigate a pure-elisp `init.el'. So that's
8;; what I'm doing. 8;; what I'm doing.
9;;; Custom Functions
10(defun acdw/split-and-follow-window-below ()
11 "Split the window below and switch to the split."
12 (interactive)
13 (split-window-below)
14 (balance-windows)
15 (other-window 1))
16
17(defun acdw/split-and-follow-window-right ()
18 "Split the window right and switch to the split."
19 (interactive)
20 (split-window-right)
21 (balance-windows)
22 (other-window 1))
23
24(defun acdw/full-auto-save ()
25 "Save all buffers that (a) have files associated and (b) are modified."
26 (interactive)
27 (save-excursion
28 (dolist (buf (buffer-list))
29 (set-buffer buf)
30 (if (and (buffer-file-name) (buffer-modified-p))
31 (basic-save-buffer)))))
32
33(defun acdw/kill-this-buffer ()
34 "Kill the current buffer."
35 (interactive)
36 (kill-buffer nil))
37
38;; https://bling.github.io/blog/2016/01/18/why-are-you-changing-gc-cons-threshold/
39(defun acdw/stop-gc ()
40 "Stop garbage collection by setting it to a very high number."
41 (setq gc-cons-threshold most-positive-fixnum))
42
43(defun acdw/start-gc ()
44 "Start garbage collection by resetting it to `*acdw/gc-cons*'."
45 (setq gc-cons-threshold *acdw/gc-cons*))
46
47(defun post-to-gemlog-blue (post-title user pass)
48 "Post current buffer to gemlog.blue."
49 (interactive
50 (let* ((title-maybe (progn ;; TODO this is ... clunky
51 (goto-char (point-min))
52 (if (re-search-forward "^# \\(.*\\)" nil t)
53 (buffer-substring-no-properties
54 (match-beginning 1)
55 (match-end 1))
56 "")))
57 (title (read-string
58 (format "Title%s: "
59 (if (string= "" title-maybe)
60 ""
61 (concat " (" title-maybe ")")))
62 nil nil title-maybe))
63 (user (read-string "User: " nil))
64 (pass (read-passwd "Pass: " nil)))
65 (list title user pass)))
66
67 (require 'mm-url)
68 (let ((url-request-method "POST")
69 (url-request-extra-headers
70 '(("Content-Type" . "application/x-www-form-urlencoded")))
71 (url-request-data
72 (mm-url-encode-www-form-urlencoded
73 `(("title" . ,post-title)
74 ("gemloguser" . ,user)
75 ("pw" . ,pass)
76 ("post" . ,(buffer-string))))))
77 (with-current-buffer
78 (url-retrieve-synchronously "https://gemlog.blue/post.php")
79 (goto-char (point-min))
80 (re-search-forward "\\(gemini://.*\\.gmi\\)")
81 (elpher-go (match-string 1)))))
9 82
10;;; Basic emacs config & built-in packages 83;;; Basic emacs config & built-in packages
11;;;; /Really/ basic emacs config 84;;;; /Really/ basic emacs config
12;; I /did/ use `better-defaults', but it turns out that that package 85(use-package calendar
13;; is (a) short and (b) mostly overriden by other settings. 86 :straight nil
14(use-package emacs 87 :custom
15 :demand ; make sure this stuff loads 88 (calendar-location-name "Baton Rouge, LA")
16 :init 89 (calendar-latitude 30.39)
17 ;; where I am 90 (calendar-longitude -91.83))
18 (setq calendar-location-name "Baton Rouge, LA")
19 (setq calendar-latitude 30.39)
20 (setq calendar-longitude -91.83)
21 91
22 ;; firefox is love, firefox is life 92(use-package browse-url
23 (setq browse-url-browser-function 'browse-url-firefox 93 :straight nil
24 browse-url-new-window-flag t 94 :custom
25 browse-url-firefox-new-window-is-tab t) 95 (browse-url-browser-function 'browse-url-firefox)
96 (browse-url-new-window-flag t)
97 (browse-url-firefox-new-window-is-tab t))
26 98
27 ;; honestly not sure if this is necessary 99(use-package paren
28 (autoload 'zap-up-to-char "misc" 100 :straight nil
29 "Kill up to, but not including, ARGth occurence of CHAR." t) 101 :custom
102 (show-paren-style 'mixed)
103 :hook
104 (after-init-hook . show-paren-mode))
30 105
31 ;; show parentheses 106(use-package simple
32 (setq show-paren-style 'mixed) 107 :straight nil
33 (show-paren-mode) 108 :custom
109 (save-interprogram-paste-before-kill
110 t "Save existing clipboard text into killring before replacing it.")
111 :hook
112 (after-init-hook . global-visual-line-mode))
34 113
35 ;; always work on visual lines 114(use-package delsel
36 (global-visual-line-mode) 115 :straight nil
116 :hook
117 (after-init-hook . delete-selection-mode))
37 118
38 ;; make the mouse avoid where I'm typing 119(use-package emacs
39 (mouse-avoidance-mode 'jump) 120 :straight nil
121 :demand t
122 :custom
123 ;; completion
124 (completion-ignore-case t)
125 (read-buffer-completion-ignore-case t)
126 (read-file-name-completion-ignore-case t)
127 ;; etc.
128 (indent-tabs-mode nil "Indentation won't insert tabs.")
129 (visible-bell (not *acdw/at-larry*) "Don't ring a bell, unless at larry.")
130 (use-dialog-box nil "Ask questions in the modeline.")
131 (mark-even-if-inactive nil "Don't use the mark when inactive.")
132 ;; paragraphs
133 (sentence-end-double-space t "Sentences end with two spaces.")
134 ;; cursor
135 (cursor-type 'bar)
136 (cursor-in-non-selected-windows 'hollow)
137 (default-frame-alist '((tool-bar-lines . 0)
138 (menu-bar-lines . 0)
139 (vertical-scroll-bars . nil)
140 (horizontal-scroll-bars . nil)
141 (right-divider-width . 2)
142 (bottom-divider-width . 2)
143 (left-fringe-width . 2)
144 (right-fringe-width . 2)))
145 (inhibit-startup-buffer-menu t)
146 (inhibit-startup-screen t)
147 (initial-buffer-choice t "Start out in *scratch*.")
148 (initial-scratch-message nil)
149 :config
150 (fset 'yes-or-no-p 'y-or-n-p)
151 (blink-cursor-mode 0)
152 :bind
153 ("C-z" . nil)
154 ("C-x k" . acdw/kill-this-buffer)
155 ("C-x K" . kill-buffer)
156 :hook
157 (prog-mode-hook . prettify-symbols-mode)
158 ((auto-save-hook focus-out-hook) . acdw/full-auto-save)
159 (before-save-hook . delete-trailing-whitespace)
160 (minibuffer-setup-hook . acdw/stop-gc)
161 (minibuffer-exit-hook . acdw/start-gc))
40 162
41 ;; delete the selection when I start typing, like a normal editor 163(use-package display-line-numbers
42 (delete-selection-mode) 164 :straight nil
165 :when (and (fboundp 'display-line-numbers-mode)
166 (display-graphic-p))
167 :hook
168 (prog-mode-hook . display-line-numbers-mode))
43 169
44 ;; ignore case 170(use-package linum
45 (setq-default completion-ignore-case t 171 :straight nil
46 read-buffer-completion-ignore-case t 172 :unless (and (fboundp 'display-line-numbers-mode)
47 read-file-name-completion-ignore-case t) 173 (display-graphic-p))
174 :hook
175 (prog-mode-hook . linum-mode))
48 176
49 ;; etc defaults 177(use-package mule
50 (fset 'yes-or-no-p 'y-or-n-p) 178 :straight nil
51 (setq-default indent-tabs-mode nil 179 :init
52 save-interprogram-paste-before-kill t
53 apropos-do-all t
54 mouse-yank-at-point t
55 require-final-newline t
56 visible-bell (not *acdw/at-larry*)
57 ediff-window-setup-function 'ediff-setup-windows-plain
58 use-dialog-box nil
59 mark-even-if-inactive nil
60 sentence-end-double-space t)
61
62 ;; utf-8 is now, old man
63 (set-charset-priority 'unicode) 180 (set-charset-priority 'unicode)
64 (set-language-environment "UTF-8") 181 (set-language-environment "UTF-8")
65 (set-default-coding-systems 'utf-8) 182 (set-default-coding-systems 'utf-8)
@@ -67,101 +184,45 @@
67 (set-keyboard-coding-system 'utf-8) 184 (set-keyboard-coding-system 'utf-8)
68 (set-selection-coding-system 'utf-8) 185 (set-selection-coding-system 'utf-8)
69 (prefer-coding-system 'utf-8) 186 (prefer-coding-system 'utf-8)
70 (setq default-buffer-file-coding-system 'utf-8 187 :custom
71 default-process-coding-system '(utf-8-unix . utf-8-unix) 188 (default-buffer-file-coding-system 'utf-8)
72 locale-coding-system 'utf-8) 189 (default-process-coding-system '(utf-8-unix . utf-8-unix))
73 190 (locale-coding-system 'utf-8))
74 ;; don't confirm killing 191
75 (setq confirm-kill-processes nil 192(use-package mouse
76 confirm-kill-emacs nil) 193 :straight nil
77 194 :custom
78 ;; simplify the GUI 195 (mouse-yank-at-point t "Yank at point instead of click."))
79 (setq default-frame-alist '((tool-bar-lines . 0)
80 (menu-bar-lines . 0)
81 (vertical-scroll-bars . nil)
82 (horizontal-scroll-bars . nil)
83 (right-divider-width . 2)
84 (bottom-divider-width . 2)
85 (left-fringe-width . 2)
86 (right-fringe-width . 2))
87 inhibit-startup-buffer-menu t
88 inhibit-startup-screen t
89 initial-buffer-choice t
90 initial-scratch-message nil)
91
92 ;; set up the cursor
93 (blink-cursor-mode 0)
94 (setq-default cursor-type 'bar
95 cursor-in-non-selected-windows 'hollow)
96
97 ;; display line numbers in `prog-mode'
98 (add-hook 'prog-mode-hook
99 (if (and (fboundp 'display-line-numbers-mode)
100 (display-graphic-p))
101 #'display-line-numbers-mode
102 #'linum-mode))
103
104 ;; custom functions
105 (defun split-and-follow-below ()
106 "Split the window below and switch to the split."
107 (interactive)
108 (split-window-below)
109 (balance-windows)
110 (other-window 1))
111
112 (defun split-and-follow-right ()
113 "Split the window right and switch to the split."
114 (interactive)
115 (split-window-right)
116 (balance-windows)
117 (other-window 1))
118
119 (defun full-auto-save ()
120 "Save all buffers that (a) have files associated and (b) are modified."
121 (interactive)
122 (save-excursion
123 (dolist (buf (buffer-list))
124 (set-buffer buf)
125 (if (and (buffer-file-name) (buffer-modified-p))
126 (basic-save-buffer)))))
127
128 (defun kill-this-buffer ()
129 "Kill the current buffer."
130 (interactive)
131 (kill-buffer nil))
132 196
197(use-package files
198 :straight nil
199 :custom
200 (require-final-newline t)
201 (confirm-kill-processes nil)
202 (confirm-kill-emacs nil)
133 :bind 203 :bind
134 ("C-x C-b" . ibuffer) 204 ("C-x f" . find-file))
135 ("M-z" . zap-up-to-char)
136 ([remap split-window-below] . split-and-follow-below)
137 ([remap split-window-right] . split-and-follow-right)
138 ("C-x f" . find-file)
139 ("C-z" . nil)
140 ("C-x k" . kill-this-buffer)
141 ("C-x K" . kill-buffer)
142 205
143 :hook 206(use-package window
144 (prog-mode-hook . prettify-symbols-mode) 207 :straight nil
145 ((auto-save-hook focus-out-hook) . full-auto-save) 208 :bind
146 (before-save-hook . delete-trailing-whitespace)) 209 ([remap split-window-below] . acdw/split-and-follow-window-below)
210 ([remap split-window-right] . acdw/split-and-follow-window-right))
147 211
148;;;; Keep .emacs.d clean 212;;;; Keep .emacs.d clean
149;; load this early for other packages to use 213;; load this early for other packages to use
150(use-package no-littering 214(use-package no-littering
151 :demand 215 :demand
216 :custom
217 (create-lockfiles nil)
218 (delete-old-versions t)
219 (kept-new-versions 6)
220 (kept-old-versions 2)
221 (version-control t)
152 :config 222 :config
153 (setq custom-file (no-littering-expand-etc-file-name "custom.el")) 223 (setq custom-file (no-littering-expand-etc-file-name "custom.el"))
154
155 (setq create-lockfiles nil)
156
157 (setq delete-old-versions t
158 kept-new-versions 6
159 kept-old-versions 2
160 version-control t)
161
162 (setq backup-directory-alist 224 (setq backup-directory-alist
163 `((".*" . ,(no-littering-expand-var-file-name "backup/")))) 225 `((".*" . ,(no-littering-expand-var-file-name "backup/"))))
164
165 (setq auto-save-file-name-transforms 226 (setq auto-save-file-name-transforms
166 `((".*" ,(no-littering-expand-var-file-name "auto-save/") t))) 227 `((".*" ,(no-littering-expand-var-file-name "auto-save/") t)))
167 (auto-save-mode)) 228 (auto-save-mode))
@@ -169,49 +230,51 @@
169;;;; Uniquily name buffers 230;;;; Uniquily name buffers
170(use-package uniquify 231(use-package uniquify
171 :straight nil 232 :straight nil
172 :init 233 :custom
173 (setq uniquify-buffer-name-style 'forward)) 234 (uniquify-buffer-name-style 'forward))
174 235
175;;;; Use async when possible 236;;;; Use async when possible
176(use-package async 237(use-package async
177 :config 238 :config ;; not sure when this is loaded
178 (dired-async-mode)) 239 (dired-async-mode))
179 240
180;;;; Autocompile elisp files (like this one) 241;;;; Autocompile elisp files (like this one)
181(use-package auto-compile 242(use-package auto-compile
182 :init 243 :custom
183 (setq load-prefer-newer t) 244 (load-prefer-newer t)
184 :config 245 :hook
185 (auto-compile-on-load-mode)) 246 (emacs-lisp-mode-hook . (lambda ()
247 (auto-compile-on-load-mode)
248 (auto-compile-on-save-mode))))
186 249
187;;;; Recent files 250;;;; Recent files
188(use-package recentf 251(use-package recentf
189 :init
190 (setq recentf-max-menu-items 100
191 recentf-max-saved-items 100)
192 :config 252 :config
193 (add-to-list 'recentf-exclude no-littering-var-directory) 253 (add-to-list 'recentf-exclude no-littering-var-directory)
194 (add-to-list 'recentf-exclude no-littering-etc-directory) 254 (add-to-list 'recentf-exclude no-littering-etc-directory)
195 (recentf-mode)) 255 :custom
256 (recentf-max-menu-items 100)
257 (recentf-max-saved-items 100)
258 :hook
259 (after-init-hook . recentf-mode))
196 260
197;;;; Save places in files 261;;;; Save places in files
198(use-package saveplace 262(use-package saveplace
199 :init 263 :custom
200 (setq save-place-file (no-littering-expand-var-file-name "places")) 264 (save-place-file (no-littering-expand-var-file-name "places"))
201 (when *acdw/at-work* 265 (save-place-forget-unreadable-files (not *acdw/at-work*))
202 (setq save-place-forget-unreadable-files nil)) 266 :hook
203 :config 267 (after-init-hook . save-place-mode))
204 (save-place-mode))
205 268
206;;;; Save history of commands, etc. 269;;;; Save history of commands, etc.
207(use-package savehist 270(use-package savehist
208 :init 271 :custom
209 (setq savehist-additional-variables 272 (savehist-additional-variables
210 '(kill-ring 273 '(kill-ring
211 search-ring 274 search-ring
212 regexp-search-ring)) 275 regexp-search-ring))
213 :config 276 :hook
214 (savehist-mode)) 277 (after-init-hook . savehist-mode))
215 278
216;;;; Authority sources for logins 279;;;; Authority sources for logins
217;; TODO: use gpg 280;; TODO: use gpg
@@ -234,11 +297,10 @@
234;;;;; Pop-up help for keys 297;;;;; Pop-up help for keys
235(use-package which-key 298(use-package which-key
236 :diminish which-key-mode 299 :diminish which-key-mode
237 :init 300 :custom
238 (setq which-key-enable-extended-define-key t) 301 (which-key-enable-extended-define-key t)
239 :config 302 :hook
240 (which-key-setup-side-window-right-bottom) 303 (after-init-hook . which-key-mode))
241 (which-key-mode))
242 304
243;;;;; A better help buffer 305;;;;; A better help buffer
244(use-package helpful 306(use-package helpful
@@ -252,8 +314,8 @@
252 314
253;;;;; A better `outline-mode' 315;;;;; A better `outline-mode'
254(use-package outshine 316(use-package outshine
255 :init 317 :custom
256 (setq outshine-cycle-emulate-tab t) 318 (outshine-cycle-emulate-tab t)
257 :bind (:map outshine-mode-map 319 :bind (:map outshine-mode-map
258 ("<S-iso-lefttab>" . outshine-cycle-buffer) 320 ("<S-iso-lefttab>" . outshine-cycle-buffer)
259 ("<backtab>" . outshine-cycle-buffer)) 321 ("<backtab>" . outshine-cycle-buffer))
@@ -262,80 +324,81 @@
262 324
263;;;;; Item selection & narrowing 325;;;;; Item selection & narrowing
264(use-package selectrum 326(use-package selectrum
327 :custom
328 (enable-recursive-minibuffers t)
265 :init 329 :init
266 (setq enable-recursive-minibuffers t)
267 (minibuffer-depth-indicate-mode) 330 (minibuffer-depth-indicate-mode)
268 :config 331 :hook
269 (selectrum-mode)) 332 (after-init-hook . selectrum-mode))
270 333
271(use-package prescient) 334(use-package prescient)
272 335
273(use-package selectrum-prescient 336(use-package selectrum-prescient
274 :config 337 :hook
275 (selectrum-prescient-mode) 338 (after-init-hook . (lambda ()
276 (prescient-persist-mode)) 339 (selectrum-prescient-mode)
340 (prescient-persist-mode))))
277 341
278;;;;; Searching 342;;;;; Searching
279(use-package ctrlf 343(use-package ctrlf
280 :config 344 :hook
281 (ctrlf-mode)) 345 (after-init-hook . ctrlf-mode))
282 346
283;;;;; Visually switch windows 347;;;;; Visually switch windows
284(use-package switch-window 348(use-package ctrlxo
285 :init 349 :straight (ctrlxo
286 (setq switch-window-shortcut-style 'qwerty) 350 :host github
351 :repo "muffinmad/emacs-ctrlxo")
287 :bind 352 :bind
288 ([remap other-window] . switch-window) 353 ([remap other-window] . ctrlxo))
289 ("s-o" . switch-window))
290 354
291;;;; Theming, looks, fonts 355;;;; Theming, looks, fonts
292;;;;; Fonts 356;;;;; Fonts
293;; I'm doing these outside of any 'package' b/c ... idk. I want to? 357;; https://github.com/kaushalmodi/.emacs.d/blob/master/init.el#L376
294(let* ((fixed-pitch-sans-serif-family 358;; modi/font-check
295 (cond ((x-list-fonts "Fira Code") '(:family "Fira Code")) 359(defun acdw/setup-fonts ()
296 ((x-list-fonts "Consolas") '(:family "Consolas")) 360 (let* ((fixed-pitch-sans-serif-family
297 ((x-list-fonts "DejaVu Sans Mono") '(:family "DejaVu Sans Mono")) 361 (cond ((x-list-fonts "Fira Code") '(:family "Fira Code"))
298 ((x-list-fonts "Fixed") '(:family "Fixed")) 362 ((x-list-fonts "Consolas") '(:family "Consolas"))
299 (nil (warn "Can't find a good fixed pitch sans-serif font.")))) 363 ((x-list-fonts "DejaVu Sans Mono") '(:family "DejaVu Sans Mono"))
300 (fixed-pitch-serif-family 364 ((x-list-fonts "Fixed") '(:family "Fixed"))
301 (cond ((x-list-fonts "Go Mono") '(:family "Go Mono")) 365 (nil (warn "Can't find a good fixed pitch sans-serif font."))))
302 ((x-list-fonts "Courier Prime") '(:family "Courier Prime")) 366 (fixed-pitch-serif-family
303 ((x-list-fonts "Courier New") '(:family "Courier New")) 367 (cond ((x-list-fonts "Go Mono") '(:family "Go Mono"))
304 ((x-list-fonts "Courier") '(:family "Courier")) 368 ((x-list-fonts "Courier Prime") '(:family "Courier Prime"))
305 (nil (warn "Can't find a good fixed pitch serif font.")))) 369 ((x-list-fonts "Courier New") '(:family "Courier New"))
306 (variable-pitch-sans-serif-family 370 ((x-list-fonts "Courier") '(:family "Courier"))
307 (cond ((x-list-fonts "DejaVu Sans") '(:family "DejaVu Sans")) 371 (nil (warn "Can't find a good fixed pitch serif font."))))
308 ((x-list-fonts "Go") '(:family "Go")) 372 (variable-pitch-sans-serif-family
309 ((x-list-fonts "Arial") '(:family "Arial")) 373 (cond ((x-list-fonts "DejaVu Sans") '(:family "DejaVu Sans"))
310 (nil (warn "Cant't find a good variable pitch sans-serif font.")))) 374 ((x-list-fonts "Go") '(:family "Go"))
311 (variable-pitch-serif-family 375 ((x-list-fonts "Arial") '(:family "Arial"))
312 (cond ((x-list-fonts "DejaVu Serif") '(:family "DejaVu Serif")) 376 (nil (warn "Cant't find a good variable pitch sans-serif font."))))
313 ((x-list-fonts "Georgia") '(:family "Georgia")) 377 (variable-pitch-serif-family
314 ((x-list-fonts "Times New Roman") '(:family "Times New Roman")) 378 (cond ((x-list-fonts "DejaVu Serif") '(:family "DejaVu Serif"))
315 ((x-list-fonts "Times") '(:family "Times")) 379 ((x-list-fonts "Georgia") '(:family "Georgia"))
316 (nil (warn "Can't find a good variable pitch serif font.")))) 380 ((x-list-fonts "Times New Roman") '(:family "Times New Roman"))
317 381 ((x-list-fonts "Times") '(:family "Times"))
318 (fixed-pitch-family fixed-pitch-sans-serif-family) 382 (nil (warn "Can't find a good variable pitch serif font."))))
319 (variable-pitch-family variable-pitch-serif-family) 383
320 (default-family fixed-pitch-family)) 384 (fixed-pitch-family fixed-pitch-sans-serif-family)
321 (custom-theme-set-faces 385 (variable-pitch-family variable-pitch-serif-family)
322 'user 386 (default-family fixed-pitch-family))
323 `(fixed-pitch ((t (,@fixed-pitch-family)))) 387 (custom-theme-set-faces
324 `(fixed-pitch-serif ((t (,@fixed-pitch-serif-family)))) 388 'user
325 `(variable-pitch ((t (,@variable-pitch-family)))) 389 `(fixed-pitch ((t (,@fixed-pitch-family))))
326 `(default ((t (,@default-family)))))) 390 `(fixed-pitch-serif ((t (,@fixed-pitch-serif-family))))
391 `(variable-pitch ((t (,@variable-pitch-family))))
392 `(default ((t (,@default-family))))))
393 (remove-hook 'focus-in-hook #'acdw/setup-fonts))
394(add-hook 'focus-in-hook #'acdw/setup-fonts)
327;;;;; Modeline 395;;;;; Modeline
328(use-package doom-modeline 396(use-package doom-modeline
329 :init 397 :custom
330 (setq doom-modeline-icon nil 398 (doom-modeline-icon nil)
331 doom-modeline-enable-word-count t) 399 (doom-modeline-enable-word-count t)
332
333 ;; (when *acdw/at-larry*
334 ;; (setq display-time-format "%R")
335 ;; (display-time-mode))
336
337 :hook 400 :hook
338 (window-setup-hook . doom-modeline-mode)) 401 (after-init-hook . doom-modeline-mode))
339 402
340;;;;; Ligatures 403;;;;; Ligatures
341(use-package ligature 404(use-package ligature
@@ -358,22 +421,21 @@
358 ":=" "..." ":>" ":<" ">:" "<:" 421 ":=" "..." ":>" ":<" ">:" "<:"
359 "::=" ;; add others here 422 "::=" ;; add others here
360 )) 423 ))
361 (global-ligature-mode)) 424 :hook
425 (after-init-hook . global-ligature-mode))
362 426
363;;;;; Unicode 427;;;;; Unicode
364(use-package unicode-fonts 428(use-package unicode-fonts
365 :config 429 :hook
366 (unicode-fonts-setup)) 430 (after-init-hook . unicode-fonts-setup))
367 431
368;;;;; Modus themes 432;;;;; Modus themes
369(use-package modus-operandi-theme 433(use-package modus-operandi-theme
370 :if window-system
371 :config 434 :config
372 (load-theme 'modus-operandi t t) 435 (load-theme 'modus-operandi t t)
373 436
374 (defun acdw/sunrise () 437 (defun acdw/sunrise ()
375 (enable-theme 'modus-operandi) 438 (enable-theme 'modus-operandi))
376 (start-process-shell-command "light" nil "light -S 60"))
377 439
378 (if *acdw/at-work* 440 (if *acdw/at-work*
379 (enable-theme 'modus-operandi) 441 (enable-theme 'modus-operandi)
@@ -382,13 +444,11 @@
382 444
383(when *acdw/at-home* 445(when *acdw/at-home*
384 (use-package modus-vivendi-theme 446 (use-package modus-vivendi-theme
385 :if window-system
386 :config 447 :config
387 (load-theme 'modus-vivendi t t) 448 (load-theme 'modus-vivendi t t)
388 449
389 (defun acdw/sunset () 450 (defun acdw/sunset ()
390 (enable-theme 'modus-vivendi) 451 (enable-theme 'modus-vivendi))
391 (start-process-shell-command "light" nil "light -S 35"))
392 452
393 (run-at-time (nth 4 (split-string (sunrise-sunset))) 453 (run-at-time (nth 4 (split-string (sunrise-sunset)))
394 (* 60 60 24) #'acdw/sunset) 454 (* 60 60 24) #'acdw/sunset)
@@ -403,8 +463,8 @@
403 463
404;;;;; Show text commands acted on 464;;;;; Show text commands acted on
405(use-package volatile-highlights 465(use-package volatile-highlights
406 :config 466 :hook
407 (volatile-highlights-mode)) 467 (after-init-hook . volatile-highlights-mode))
408 468
409;;;;; Visual replacement for `zap-to-char' 469;;;;; Visual replacement for `zap-to-char'
410(use-package zop-to-char 470(use-package zop-to-char
@@ -420,8 +480,8 @@
420 480
421;;;;; Operate on the current line if no region is active 481;;;;; Operate on the current line if no region is active
422(use-package whole-line-or-region 482(use-package whole-line-or-region
423 :config 483 :hook
424 (whole-line-or-region-global-mode)) 484 (after-init-hook . whole-line-or-region-global-mode))
425 485
426;;;;; Expand region 486;;;;; Expand region
427(use-package expand-region 487(use-package expand-region
@@ -432,9 +492,9 @@
432 492
433;;;;; Code completion 493;;;;; Code completion
434(use-package company 494(use-package company
435 :init 495 :custom
436 (setq company-idle-delay 0.1 496 (company-idle-delay 0.1)
437 company-show-numbers t) 497 (company-show-numbers t)
438 :config 498 :config
439 (let ((map company-active-map)) 499 (let ((map company-active-map))
440 (mapc (lambda (x) 500 (mapc (lambda (x)
@@ -459,7 +519,7 @@
459 519
460;;;;; Git integration 520;;;;; Git integration
461(use-package magit 521(use-package magit
462 :if *acdw/at-home* 522 :when *acdw/at-home*
463 :bind 523 :bind
464 ("C-x g" . magit-status) 524 ("C-x g" . magit-status)
465 :config 525 :config
@@ -474,7 +534,7 @@
474 ) 534 )
475 535
476(use-package forge 536(use-package forge
477 :if *acdw/at-home* 537 :when *acdw/at-home*
478 :after magit 538 :after magit
479 :config 539 :config
480 (setq forge-owned-accounts '(("duckwork")))) 540 (setq forge-owned-accounts '(("duckwork"))))
@@ -489,9 +549,10 @@
489 549
490;;;;;; Smartly deal with pairs 550;;;;;; Smartly deal with pairs
491(use-package smartparens 551(use-package smartparens
492 :config 552 :hook
493 (require 'smartparens-config) 553 (prog-mode-hook . (lambda ()
494 (smartparens-global-mode)) 554 (require 'smartparens-config)
555 (smartparens-global-mode))))
495 556
496;;;;;; Show delimiters as different colors 557;;;;;; Show delimiters as different colors
497(use-package rainbow-delimiters 558(use-package rainbow-delimiters
@@ -507,9 +568,9 @@
507 568
508;;;;; `fill-column', but in `visual-line-mode' 569;;;;; `fill-column', but in `visual-line-mode'
509(use-package visual-fill-column 570(use-package visual-fill-column
510 :init 571 :custom
511 (setq split-window-preferred-function 'visual-fill-column-split-window-sensibly) 572 (split-window-preferred-function 'visual-fill-column-split-window-sensibly)
512 (setq visual-fill-column-center-text t) 573 (visual-fill-column-center-text t)
513 :config 574 :config
514 (advice-add 'text-scale-adjust 575 (advice-add 'text-scale-adjust
515 :after #'visual-fill-column-adjust)) 576 :after #'visual-fill-column-adjust))
@@ -521,13 +582,13 @@
521 582
522;;;;;; Edit files with `sudo' (I think?) 583;;;;;; Edit files with `sudo' (I think?)
523 (use-package su 584 (use-package su
524 :config 585 :hook
525 (su-mode)) 586 (after-init-hook . su-mode))
526 587
527;;;;;; Implement XDG Trash specification 588;;;;;; Implement XDG Trash specification
528 (use-package trashed 589 (use-package trashed
529 :init 590 :custom
530 (setq delete-by-moving-to-trash t)) 591 (delete-by-moving-to-trash t))
531 592
532;;;;;; Build exec-path from $PATH 593;;;;;; Build exec-path from $PATH
533 (use-package exec-path-from-shell 594 (use-package exec-path-from-shell
@@ -554,150 +615,18 @@
554 615
555(use-package gemini-mode 616(use-package gemini-mode
556 :straight (gemini-mode 617 :straight (gemini-mode
557 :repo "https://git.carcosa.net/jmcbray/gemini.el.git")) 618 :repo "https://git.carcosa.net/jmcbray/gemini.el.git")
619 :hook (gemini-mode-hook . (lambda ()
620 ;; (variable-pitch-mode)
621 (set-fill-column 100)
622 (visual-fill-column-mode))))
558 623
559(use-package gemini-write 624(use-package gemini-write
560 :straight (gemini-write 625 :straight (gemini-write
561 :repo "https://alexschroeder.ch/cgit/gemini-write")) 626 :repo "https://alexschroeder.ch/cgit/gemini-write"))
562 627
563(defun post-to-gemlog-blue (post-title user pass)
564 "Post current buffer to gemlog.blue."
565 (interactive
566 (let* ((title-maybe (progn ;; TODO this is ... clunky
567 (goto-char (point-min))
568 (if (re-search-forward "^# \\(.*\\)" nil t)
569 (buffer-substring-no-properties
570 (match-beginning 1)
571 (match-end 1))
572 "")))
573 (title (read-string
574 (format "Title%s: "
575 (if (string= "" title-maybe)
576 ""
577 (concat " (" title-maybe ")")))
578 nil nil title-maybe))
579 (user (read-string "User: " nil))
580 (pass (read-passwd "Pass: " nil)))
581 (list title user pass)))
582
583 (require 'mm-url)
584 (let ((url-request-method "POST")
585 (url-request-extra-headers
586 '(("Content-Type" . "application/x-www-form-urlencoded")))
587 (url-request-data
588 (mm-url-encode-www-form-urlencoded
589 `(("title" . ,post-title)
590 ("gemloguser" . ,user)
591 ("pw" . ,pass)
592 ("post" . ,(buffer-string))))))
593 (with-current-buffer
594 (url-retrieve-synchronously "https://gemlog.blue/post.php")
595 (goto-char (point-min))
596 (re-search-forward "\\(gemini://.*\\.gmi\\)")
597 (elpher-go (match-string 1)))))
598
599;;;; exwm ~ Emacs X Window Manager
600;; (when *acdw/at-larry*
601;; (use-package exwm
602;; :if window-system
603;; :demand
604;; :init
605;; (add-to-list 'default-frame-alist '(fullscreen . maximized)))
606;; :custom
607;; (exwm-layout-show-all-buffers t)
608;; (exwm-workspace-warp-cursor t)
609;; ;;(mouse-autoselect-window t)
610;; (exwm-workspace-number 4)
611;; (exwm-input-global-keys
612;; `(
613;; ([remap split-window-below] . split-and-follow-below)
614;; ([remap split-window-right] . split-and-follow-right)
615;; ([?\s-r] . exwm-reset)
616;; ([?\s-w] . exwm-workspace-switch)
617;; ([?\s-&] . (lambda (command)
618;; (interactive (list (read-shell-command "$ ")))
619;; (start-process-shell-command command nil command)))
620;; ,@(mapcar (lambda (i)
621;; `(,(kbd (format "s-%d" i)) .
622;; (lambda ()
623;; (interactive)
624;; (exwm-workspace-switch-create ,i))))
625;; (number-sequence 0 9))))
626;; (exwm-input-simulation-keys
627;; '(([?\C-b] . [left])
628;; ([?\M-b] . [C-left])
629;; ([?\C-f] . [right])
630;; ([?\M-f] . [C-right])
631;; ([?\C-p] . [up])
632;; ([?\C-n] . [down])
633;; ([?\C-a] . [home])
634;; ([?\C-e] . [end])
635;; ([?\M-v] . [prior])
636;; ([?\C-v] . [next])
637;; ([?\C-d] . [delete])
638;; ([?\C-k] . [S-end delete])
639;; ([?\C-s] . [?\C-f])
640;; ([?\C-w] . [?\C-x])
641;; ([?\M-w] . [?\C-c])
642;; ([?\C-y] . [?\C-v])))
643;; :hook
644;; ((exwm-update-class-hook .
645;; (lambda () "Rename buffer to window's class name"
646;; (exwm-workspace-rename-buffer exwm-class-name)))
647;; (exwm-update-title-hook .
648;; (lambda () "Update workspace name to window title"
649;; (when (not exwm-instance-name)
650;; (exwm-workspace-rename-buffer exwm-title))))
651;; (exwm-init-hook . window-divider-mode)
652;; (exwm-init-hook .
653;; (lambda () "Autostart"
654;; (start-process-shell-command "cmst" nil "cmst -m -w 5")
655;; (start-process-shell-command "keepassxc" nil "keepassxc")
656;; (start-process-shell-command
657;; "pa-applet" nil
658;; "pa-applet --disable-key-grabbing --disable-notifications")
659;; (start-process-shell-command
660;; "cbatticon" nil "cbatticon"))))
661;; :config
662;; (require 'exwm)
663;; (exwm-enable)
664;; (require 'exwm-systemtray)
665;; (exwm-systemtray-enable))
666
667;; (use-package exwm-firefox-core
668;; :after exwm
669;; :straight (exwm-firefox-core
670;; :type git
671;; :host github
672;; :repo "walseb/exwm-firefox-core"))
673
674;; (use-package exwm-firefox
675;; :after exwm-firefox-core
676;; :straight (exwm-firefox
677;; :type git
678;; :host github
679;; :repo "ieure/exwm-firefox")
680;; :config
681;; (exwm-firefox-mode))
682
683;; (use-package exwm-mff
684;; :straight (exwm-mff
685;; :host github
686;; :repo "ieure/exwm-mff"
687;; :fork (
688;; :host github
689;; :repo "duckwork/exwm-mff"))
690;; :after exwm
691;; :hook
692;; (exwm-init-hook . exwm-mff-mode))
693
694;; (use-package exwm-edit)
695
696;; ) ;; end of *acdw/at-larry* block for exwm
697
698;;;; IRC 628;;;; IRC
699(use-package circe 629(use-package circe
700 :if *acdw/at-larry*
701 :init 630 :init
702 (defun my/fetch-password (&rest params) 631 (defun my/fetch-password (&rest params)
703 "Fetch a password from auth-sources" 632 "Fetch a password from auth-sources"
@@ -790,14 +719,14 @@
790 719
791;;;; org-mode 720;;;; org-mode
792(use-package org 721(use-package org
793 :init 722 :custom
794 (setq org-startup-indented t) 723 (org-startup-indented t)
795 (setq org-src-tab-acts-natively t) 724 (org-src-tab-acts-natively t)
796 (setq org-hide-emphasis-markers t) 725 (org-hide-emphasis-markers t)
797 (setq org-fontify-done-headline t) 726 (org-fontify-done-headline t)
798 (setq org-hide-leading-stars t) 727 (org-hide-leading-stars t)
799 (setq org-pretty-entities t) 728 (org-pretty-entities t)
800 729 :config
801 (font-lock-add-keywords 'org-mode 730 (font-lock-add-keywords 'org-mode
802 '(("^ *\\([-+*]\\) " 731 '(("^ *\\([-+*]\\) "
803 (0 (prog1 () (compose-region (match-beginning 1) 732 (0 (prog1 () (compose-region (match-beginning 1)
@@ -808,13 +737,14 @@
808 737
809(use-package org-bullets 738(use-package org-bullets
810 :hook 739 :hook
811 (org-mode-hook . (lambda () (org-bullets-mode)))) 740 (org-mode-hook . org-bullets-mode))
812 741
813;;;; SLIME -- for LISP 742;;;; SLIME -- for LISP
814(use-package slime 743(use-package slime
815 :init 744 :custom
816 (setq inferior-lisp-program (cond ((executable-find "sbcl") 745 (inferior-lisp-program (cond ((executable-find "sbcl")
817 (executable-find "sbcl"))))) 746 (executable-find "sbcl")))))
747
818 748
819(provide 'init) 749(provide 'init)
820;;; init.el ends here 750;;; init.el ends here