summary refs log tree commit diff stats
path: root/config.org
diff options
context:
space:
mode:
authorCase Duckworth2020-11-21 23:24:59 -0600
committerCase Duckworth2020-11-21 23:24:59 -0600
commitdbd3abcbd507c53b625377566ceb166ebbac1b81 (patch)
tree3ff54597d162c17b56d4dfbd0f85357d5a8cc367 /config.org
parentfull on bankruptcy (diff)
downloademacs-dbd3abcbd507c53b625377566ceb166ebbac1b81.tar.gz
emacs-dbd3abcbd507c53b625377566ceb166ebbac1b81.zip
Pulling myself ever-so-slowly out of the hole
Diffstat (limited to 'config.org')
-rw-r--r--config.org479
1 files changed, 447 insertions, 32 deletions
diff --git a/config.org b/config.org index 08a5418..01e5ac2 100644 --- a/config.org +++ b/config.org
@@ -43,6 +43,8 @@
43 (expand-file-name 43 (expand-file-name
44 (concat user-emacs-directory "config.org")))))) 44 (concat user-emacs-directory "config.org"))))))
45 45
46 (add-hook 'after-save-hook #'acdw/tangle-init)
47
46 (defun acdw/load-init () 48 (defun acdw/load-init ()
47 (interactive) 49 (interactive)
48 (load-file (expand-file-name 50 (load-file (expand-file-name
@@ -80,12 +82,55 @@
80 (straight-use-package 'use-package) 82 (straight-use-package 'use-package)
81#+end_src 83#+end_src
82 84
85* Macros
86
87** Customizing variables
88
89#+begin_src emacs-lisp
90 (defmacro cuss (var val)
91 "Basically `use-package''s `:custom', but without using either."
92 `(progn
93 (funcall (or (get ',var 'custom-set) #'set-default)
94 ',var ,val)))
95#+end_src
96
83* Theme 97* Theme
84 98
85I want to try using the [[https://github.com/kunalb/poet][Poet]] theme. 99I'm using the [[https://protesilaos.com/modus-themes/][Modus]] themes.
86 100
87#+begin_src emacs-lisp 101#+begin_src emacs-lisp
88 (use-package poet-theme) 102 (defmacro modus-themes-format-sexp (sexp &rest objects)
103 `(eval (read (format ,(format "%S" sexp) ,@objects))))
104
105 (dolist (theme '("operandi" "vivendi"))
106 (modus-themes-format-sexp
107 (use-package modus-%1$s-theme
108 :init
109 (setq modus-%1$s-theme-slanted-constructs t
110 modus-%1$s-theme-bold-constructs t
111 modus-%1$s-theme-fringes 'subtle
112 modus-%1$s-theme-mode-line '3d
113 modus-%1$s-theme-syntax 'yellow-comments
114 modus-%1$s-theme-intense-hl-line nil
115 modus-%1$s-theme-intense-paren-match t
116 modus-%1$s-theme-links nil
117 modus-%1$s-theme-no-mixed-fonts nil
118 modus-%1$s-theme-prompts nil
119 modus-%1$s-theme-completions nil
120 modus-%1$s-theme-diffs nil
121 modus-%1$s-theme-org-blocks 'grayscale
122 modus-%1$s-theme-headings
123 '((1 . section)
124 (2 . line)
125 (t . rainbow-line-no-bold))
126 modus-%1$s-theme-variable-pitch-headings nil
127 modus-%1$s-theme-scale-headings t
128 modus-%1$s-theme-scale-1 1.1
129 modus-%1$s-theme-scale-2 1.15
130 modus-%1$s-theme-scale-3 1.21
131 modus-%1$s-theme-scale-4 1.27
132 modus-%1$s-theme-scale-5 1.33))
133 theme))
89#+end_src 134#+end_src
90 135
91I also want to switch themes between night and day. 136I also want to switch themes between night and day.
@@ -96,7 +141,7 @@ I also want to switch themes between night and day.
96 (calendar-latitude 30.39) 141 (calendar-latitude 30.39)
97 (calendar-longitude -91.83) 142 (calendar-longitude -91.83)
98 :config 143 :config
99 (change-theme 'poet 'poet-dark)) 144 (change-theme 'modus-operandi 'modus-vivendi))
100#+end_src 145#+end_src
101 146
102* Simplify GUI 147* Simplify GUI
@@ -109,32 +154,57 @@ I also want to switch themes between night and day.
109 (global-visual-line-mode 1) 154 (global-visual-line-mode 1)
110#+end_src 155#+end_src
111 156
157** Modeline
158
159#+begin_src emacs-lisp
160 (use-package smart-mode-line
161 :custom
162 (sml/no-confirm-load-theme t)
163 :config
164 (sml/setup))
165
166 (defun rm/whitelist-add (regexp)
167 "Add a REGEXP to the whitelist for `rich-minority'."
168 (if (listp 'rm--whitelist-regexps)
169 (add-to-list 'rm--whitelist-regexps regexp)
170 (setq rm--whitelist-regexps `(,regexp)))
171 (setq rm-whitelist
172 (mapconcat 'identity rm--whitelist-regexps "\\|")))
173
174 (use-package rich-minority
175 :config
176 (rm/whitelist-add "^$"))
177#+end_src
178
112* Fonts 179* Fonts
113 180
114#+begin_src emacs-lisp 181#+begin_src emacs-lisp
115 (require 'cl) 182 (require 'cl)
116 (defun font-candidate (&rest fonts) 183 (defun font-candidate (&rest fonts)
117 (loop for font in fonts 184 (loop for font in fonts
118 when (find-font (font-spec :name font)) 185 when (find-font (font-spec :name font))
119 return font)) 186 return font))
120 187
121 (set-face-attribute 'default nil 188 (set-face-attribute 'default nil
122 :font 189 :font
123 (font-candidate 190 (font-candidate
124 "Go Mono-11" 191 "Linux Libertine Mono O-11"
125 "Consolas-11")) 192 "Go Mono-11"
193 "Consolas-11"))
126 194
127 (set-face-attribute 'fixed-pitch nil 195 (set-face-attribute 'fixed-pitch nil
128 :font 196 :font
129 (font-candidate 197 (font-candidate
130 "Go Mono-11" 198 "Linux Libertine Mono O-11"
131 "Consolas-11")) 199 "Go Mono-11"
200 "Consolas-11"))
132 201
133 (set-face-attribute 'variable-pitch nil 202 (set-face-attribute 'variable-pitch nil
134 :font 203 :font
135 (font-candidate 204 (font-candidate
136 "Go-12" 205 "Linux Libertine O-12"
137 "Georgia-11")) 206 "Go-12"
207 "Georgia-11"))
138#+end_src 208#+end_src
139 209
140** Unicode 210** Unicode
@@ -148,83 +218,428 @@ I also want to switch themes between night and day.
148** Variable pitch faces 218** Variable pitch faces
149 219
150#+begin_src emacs-lisp 220#+begin_src emacs-lisp
151 (add-hook 'text-mode-hook 221 (add-hook 'text-mode-hook #'variable-pitch-mode)
152 (lambda () 222#+end_src
153 (variable-pitch-mode 1)))
154#+end_
155 223
156* TODO Emacs configuration [meta] 224* Emacs configuration [meta]
157 225
158** Keep =~/.emacs.d= tidy 226** Keep =~/.emacs.d= tidy
159 227
228#+begin_src emacs-lisp
229 (straight-use-package 'no-littering)
230 (require 'no-littering)
231#+end_src
232
233** Additional =use-package= keywords
234
235*** =:custom-update=
236
237#+begin_src emacs-lisp
238 (use-package use-package-custom-update
239 :straight (use-package-custom-update
240 :host github
241 :repo "a13/use-package-custom-update"))
242#+end_src
243
160* TODO Ease of use 244* TODO Ease of use
161 245
162** Selectrum 246** Selectrum & Prescient
247
248#+begin_src emacs-lisp
249 (use-package selectrum
250 :config
251 (selectrum-mode 1))
163 252
164** Prescient 253 (use-package prescient
254 :config
255 (prescient-persist-mode 1))
256
257 (use-package selectrum-prescient
258 :after (selectrum prescient)
259 :config
260 (selectrum-prescient-mode 1))
261#+end_src
165 262
166** CtrlF 263** CtrlF
167 264
265#+begin_src emacs-lisp
266 (use-package ctrlf
267 :custom
268 (ctrlf-show-match-count-at-eol nil)
269 :config
270 (ctrlf-mode 1))
271#+end_src
272
168** Startup 273** Startup
169 274
170** Ignore case 275#+begin_src emacs-lisp
276 (cuss inhibit-startup-buffer-menu t)
277 (cuss inhibit-startup-screen t)
278 (cuss initial-buffer-choice t)
279 (cuss initial-scratch-message ";; Hi there!\n")
280#+end_src
171 281
172* TODO Persistence 282** TODO Ignore case
283
284* Persistence
173 285
174** Auto-saves 286** Auto-saves
175 287
288#+begin_src emacs-lisp
289 (use-package super-save
290 :custom
291 (auto-save-default nil)
292 (super-save-exclue '(".gpg"))
293 :config
294 (super-save-mode 1))
295#+end_src
296
176** Backup files 297** Backup files
177 298
299#+begin_src emacs-lisp
300 (cuss backup-directory-alist
301 `((".*" . ,(no-littering-expand-var-file-name "backup/"))))
302#+end_src
303
178** Recent files 304** Recent files
179 305
306#+begin_src emacs-lisp
307 (use-package recentf
308 :custom-update
309 (recentf-exclude
310 '(no-littering-var-directory
311 no-littering-etc-directory))
312 :custom
313 (recentf-max-menu-items 100)
314 (recentf-max-saved-items 100)
315 :config
316 (recentf-mode 1))
317#+end_src
318
180** Save places in visited files 319** Save places in visited files
181 320
321#+begin_src emacs-lisp
322 (use-package saveplace
323 :custom
324 (save-place-file (no-littering-expand-var-file-name "places"))
325 (save-place-forget-unreadable-files (not
326 (eq system-type 'windows-nt))
327 :config
328 (save-place-mode 1)))
329#+end_src
330
182** Save history 331** Save history
183 332
333#+begin_src emacs-lisp
334 (use-package savehist
335 :custom
336 (savehist-additional-variables
337 '(kill-ring
338 search-ring
339 regexp-search-ring))
340 (savehist-save-minibuffer-history t)
341 :config
342 (savehist-mode 1))
343#+end_src
344
184** Undo 345** Undo
185 346
186* TODO General editing 347#+begin_src emacs-lisp
348 (use-package undo-fu-session
349 :after (no-littering undo-fu)
350 :custom
351 (undo-fu-session-incompatible-files
352 '("COMMIT_EDITMSG\\'"
353 "/git-rebase-todo\\'"))
354 (undo-fu-session-directory
355 (no-littering-expand-var-file-name "undos/"))
356 :config
357 (global-undo-fu-session-mode 1))
358#+end_src
359
360* General editing
187 361
188** Undo 362** Undo
189 363
364#+begin_src emacs-lisp
365 (use-package undo-fu
366 :bind
367 ("C-/" . undo-fu-only-undo)
368 ("C-?" . undo-fu-only-redo))
369#+end_src
370
190** Find/replace 371** Find/replace
191 372
192** Expand region 373#+begin_src emacs-lisp
374 (use-package visual-regexp
375 :bind
376 ("C-c r" . 'vr/replace)
377 ("C-c q" . 'vr/query-replace))
378#+end_src
379
380** Visual editing
381
382*** Volatile highlights
383
384#+begin_src emacs-lisp
385 (use-package volatile-highlights
386 :config
387 (volatile-highlights-mode 1))
388#+end_src
389
390*** Expand region
193 391
194* TODO Writing 392 #+begin_src emacs-lisp
393 (use-package expand-region
394 :bind
395 ("C-=" . er/expand-region)
396 ("C-+" . er/contract-region))
397 #+end_src
398
399* Writing
195 400
196** Word count 401** Word count
197 402
403#+begin_src emacs-lisp
404 (use-package wc-mode
405 :config
406 (rm/whitelist-add "WC")
407 :hook text-mode)
408#+end_src
409
198** Visual fill column mode 410** Visual fill column mode
199 411
412#+begin_src emacs-lisp
413 (use-package visual-fill-column
414 :custom
415 (split-window-preferred-function
416 'visual-fill-column-split-window-sensibly)
417 (visual-fill-column-center-text t)
418 (fill-column 80)
419 :config
420 (advice-add 'text-scale-adjust
421 :after #'visual-fill-column-adjust)
422 :hook
423 (text-mode . visual-fill-column-mode))
424#+end_src
425
200** Org mode 426** Org mode
201 427
428#+begin_src emacs-lisp
429 (use-package org
430 :custom
431 (org-startup-indented t)
432 (org-src-tab-acts-natively t)
433 (org-hide-emphasis-markers t)
434 (org-fontify-done-headline t)
435 (org-hide-leading-stars t)
436 (org-pretty-entities t))
437#+end_src
438
202* TODO Coding 439* TODO Coding
203 440
441** Indenting
442
443#+begin_src emacs-lisp
444 (use-package aggressive-indent
445 :config
446 (global-aggressive-indent-mode 1))
447#+end_src
448
204** Display 449** Display
205 450
206*** Prettify symbols mode 451*** Prettify symbols mode
207 452
453#+begin_src emacs-lisp
454 (add-hook 'prog-mode-hook #'prettify-symbols-mode)
455#+end_src
456
208*** Parentheses and frens 457*** Parentheses and frens
209 458
459**** =show-paren-style=
460
461#+begin_src emacs-lisp
462 (cuss show-paren-style 'mixed)
463 (show-paren-mode 1)
464#+end_src
465
466**** Smartparens
467
468#+begin_src emacs-lisp
469 (use-package smartparens
470 :init
471 (defun acdw/setup-smartparens ()
472 (require 'smartparens-config)
473 (smartparens-mode 1))
474 :hook
475 (prog-mode . acdw/setup-smartparens))
476#+end_src
477
478**** Rainbow delimiters
479
480#+begin_src emacs-lisp
481 (use-package rainbow-delimiters
482 :hook (prog-mode . rainbow-delimiters-mode))
483#+end_src
484
210*** Line numbers 485*** Line numbers
211 486
487#+begin_src emacs-lisp
488 (defun acdw/enable-line-numbers ()
489 "Enable line numbers, either through `display-line-numbers-mode'
490 or through `linum-mode'."
491 (if (and (fboundp 'display-line-numbers-mode)
492 (display-graphic-p))
493 (display-line-numbers-mode 1)
494 (linum-mode 1)))
495
496 (add-hook 'prog-mode-hook #'acdw/enable-line-numbers)
497#+end_src
498
212** Git 499** Git
213 500
501#+begin_src emacs-lisp
502 (use-package magit
503 :bind
504 ("C-x g" . magit-status)
505 :custom-update
506 (magit-no-confirm '(stage-all-changes)))
507#+end_src
508
509*** Hook into =prescient=
510
511#+begin_src emacs-lisp
512 (define-advice magit-list-refs
513 (:around (orig &optional namespaces format sortby)
514 prescient-sort)
515 "Apply prescient sorting when listing refs."
516 (let ((res (funcall orig namespaces format sortby)))
517 (if (or sortby
518 magit-list-refs-sortby
519 (not selectrum-should-sort-p))
520 res
521 (prescient-sort res))))
522#+end_src
523
524*** Use =libgit= when I can build it (requires =cmake=)
525
526#+begin_src emacs-lisp
527 (when (executable-find "cmake")
528 (use-package libgit)
529 (use-package magit-libgit))
530#+end_src
531
532*** Git "forge" capabilities
533
534#+begin_src emacs-lisp
535 (use-package forge
536 :after magit
537 :custom
538 (forge-owned-accounts
539 '(("duckwork"))))
540#+end_src
541
214** Programming languages 542** Programming languages
215 543
216*** Shell 544*** Fish shell
545
546#+begin_src emacs-lisp
547 (use-package fish-mode)
548#+end_src
549
550*** Lisps
217 551
218*** Lisp 552**** SLIME
219 553
220*** Fennel 554 #+begin_src emacs-lisp
555 (use-package slime
556 :when (executable-find "sbcl")
557 :custom
558 (inferior-lisp-program "sbcl")
559 (slime-contribs '(slime-fancy)))
560 #+end_src
561
562**** Fennel
563
564#+begin_src emacs-lisp
565 (use-package fennel-mode
566 :mode "\\.fnl\\'")
567#+end_src
221 568
222*** Lua 569*** Lua
223 570
571#+begin_src emacs-lisp
572 (use-package lua-mode
573 :mode "\\.lua\\'"
574 :interpreter "lua")
575#+end_src
576
224*** Web (HTML/CSS/JS) 577*** Web (HTML/CSS/JS)
225 578
579#+begin_src emacs-lisp
580 (use-package web-mode
581 :mode (("\\.ts\\'" . web-mode)
582 ("\\.html?\\'" . web-mode)
583 ("\\.css?\\'" . web-mode)
584 ("\\.js\\'" . web-mode)))
585#+end_src
586
587*** =~/.ssh/config=
588
589#+begin_src emacs-lisp
590 (use-package ssh-config-mode)
591#+end_src
592
226* Applications 593* Applications
227 594
228** Elpher 595** Elpher
229 596
597#+BEGIN_SRC emacs-lisp
598 (use-package elpher
599 :straight (elpher
600 :repo "git://thelambdalab.xyz/elpher.git")
601 :custom
602 (elpher-certificate-directory
603 (no-littering-expand-var-file-name "elpher-certificates/"))
604 (elpher-ipv4-always t)
605 :config
606 (defun elpher:eww-browse-url (original url &optional new-window)
607 "Handle gemini/gopher links with eww."
608 (cond ((string-match-p "\\`\\(gemini\\|gopher\\)://" url)
609 (require 'elpher)
610 (elpher-go url))
611 (t (funcall original url new-window))))
612 (advice-add 'eww-browse-url :around 'elpher:eww-browse-url)
613 :bind (:map elpher-mode-map
614 ("n" . elpher-next-link)
615 ("p" . elpher-prev-link)
616 ("o" . elpher-follow-current-link)
617 ("G" . elpher-go-current))
618 :hook
619 (elpher-mode . visual-fill-column-mode))
620
621 (use-package gemini-mode
622 :straight (gemini-mode
623 :repo "https://git.carcosa.net/jmcbray/gemini.el.git")
624 :mode "\\.\\(gemini|gmi\\)\\'"
625 :hook
626 (gemini-mode . visual-fill-column-mode))
627
628 (use-package gemini-write
629 :straight (gemini-write
630 :repo "https://alexschroeder.ch/cgit/gemini-write")
631 :config
632 (add-to-list 'elpher-gemini-tokens '("gem.acdw.net" . "yellow-people-eater")))
633
634 (use-package post-to-gemlog-blue
635 :straight (post-to-gemlog-blue
636 :repo "https://git.sr.ht/~acdw/post-to-gemlog-blue.el"))
637#+END_SRC
638
230** Pastebin (0x0) 639** Pastebin (0x0)
640
641#+BEGIN_SRC emacs-lisp
642 (use-package 0x0
643 :custom
644 (0x0-default-service 'ttm))
645#+END_SRC