summary refs log tree commit diff stats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md1047
1 files changed, 1047 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..f0e7217 --- /dev/null +++ b/README.md
@@ -0,0 +1,1047 @@
1
2# Table of Contents
3
41. [Preamble](#org0bff216)
52. [License](#orged58376)
63. [Bootstrap](#org4c40f13)
7 1. [Tangling](#orgdd48fb7)
84. [Early initiation](#orgf06a67b)
9 1. [Preamble](#org790f346)
10 2. [Computers](#org27a9d06)
11 3. [Package management](#org982c51d)
12 1. [At work, Git's in a weird place](#org1d43543)
13 2. [straight.el](#orgc3c01af)
14 3. [use-package](#org75b502f)
155. [Begin init.el](#orge258966)
166. [Macros](#org429e2c9)
17 1. [cuss](#org98b79c1)
187. [Files](#orgef614d8)
19 1. [Keep .emacs.d tidy](#orgcd98663)
20 2. [Customize](#orgfa8ddd8)
21 3. [Encoding](#org7d9d257)
22 4. [Recent files](#org5a20cd6)
23 5. [Backups](#org48971aa)
24 6. [Autosave](#org3243bbe)
25 7. [Save places](#org1ad3687)
26 8. [Save history](#orge49f590)
278. [User interface](#orgbaf79a4)
28 1. [Look](#org57b0df2)
29 1. [Frames and windows](#org7eea925)
30 2. [Buffers](#orgb767f7c)
31 3. [Cursor](#org8983905)
32 4. [Interactivity](#org62c9668)
33 5. [Miscellaneous](#org1ea822c)
34 2. [Themes: Modus](#org677f380)
35 1. [Change themes based on time of day](#orgb821d6f)
36 2. [Disable the current theme when a theme is interactively loaded](#org5e81fc5)
37 3. [Modeline: smart-mode-line](#org8ab1e2a)
38 4. [Fonts](#org31ee2e5)
39 1. [Ligatures](#org77dea9d)
40 2. [Unicode fonts](#orgcda6a3b)
419. [Editing](#org14ea5cc)
42 1. [Completion](#org46827ec)
43 2. [Ignore case](#orga788d6a)
44 3. [Selection & Minibuffer](#org706315a)
45 1. [Selectrum & Prescient](#org294ff45)
46 4. [Search](#org2c0ce4c)
47 1. [CtrlF for searching](#org2ee70e6)
48 2. [Visual Regexp](#orgce9fee5)
49 5. [Undo](#orgd0935a4)
50 6. [Visual editing](#org90fff82)
51 1. [`zap-to-char` replacement](#orgaf545a8)
52 2. [Operate on a line if there's no current region](#orga6c374d)
53 3. [Expand-region](#orgc10cc77)
54 4. [Volatile highlights](#orge349e7b)
55 5. [Visual line mode](#org2537d6e)
56 6. [A better `move-beginning-of-line`](#orgb4e6549)
57 7. [Delete the selection when typing](#orga87bcd4)
58 8. [Clipboard](#org383042b)
59 9. [Tabs & Spaces](#orge8f1064)
6010. [Programming](#org7ebcef6)
61 1. [Git](#org9139ba2)
62 2. [Code display](#org158c62e)
63 1. [Parentheses](#orga6fefd0)
64 3. [Line numbers](#orge880bac)
65 4. [Languages](#orgd13b98f)
66 1. [Shell](#org7b82a1d)
67 2. [Lua](#orgfe2fd7e)
68 3. [Fennel](#org3000823)
69 4. [Web](#org38d26c9)
70 5. [SSH config](#org9ae6b0f)
7111. [Writing](#org100f1c7)
72 1. [Word count](#orgfbddaf6)
73 2. [Visual fill column](#org32c015a)
74 3. [Mixed-pitch](#orgcb552ec)
75 4. [Org mode](#org3025d5a)
7612. [Applications](#org7eada39)
77 1. [Gemini & Gopher](#orgc966a52)
78 2. [Pastebin](#orgf849ba8)
79 3. [Gnus](#orge75cc1a)
80 4. [Nov.el: read Ebooks](#org82ec7aa)
8113. [Machine-specific configurations](#orga88ef69)
82
83
84
85<a id="org0bff216"></a>
86
87# Preamble
88
89I wanted to write my Emacs configuration in [Org mode](https://orgmode.org) for a while, but never could quite figure out how. Finally, I found [Lars Tveito](https://github.com/larstvei/dot-emacs)'s config, which does exactly what I want: `init.el` is small and simple, and replaced after the first run, and `init.org` is automatically tangled. So I'm very excited.
90
91
92<a id="orged58376"></a>
93
94# License
95
96WTFPL. For more info, see `LICENSE`.
97
98Probably that's not legal under the terms of the GPL or whatever Emacs is licensed under.
99SUE ME, RMS
100
101
102<a id="org4c40f13"></a>
103
104# Bootstrap
105
106*Check out Lars's config for the reasoning behind this.*
107
108When this configuration is loaded for the first time, this `init.el` is loaded:
109
110 ;; This file replaces itself with the actual configuration when first run. To keep only this version in git, run this command:
111 ;; git update-index --assume-unchanged init.el
112 ;;
113 ;; If it needs to be changed, start tracking it again thusly:
114 ;; git update-index --no-assume-unchanged init.el
115
116 (require 'org)
117 (find-file (concat user-emacs-directory "init.org"))
118 (org-babel-tangle)
119 (load-file (concat user-emacs-directory "early-init.el"))
120 (load-file (concat user-emacs-directory "init.el"))
121 (byte-compile-file (concat user-emacs-directory "init.el"))
122
123
124<a id="orgdd48fb7"></a>
125
126## Tangling
127
128After the first run, the above `init.el` will be replaced by the tangled stuff here. However, when *this* file is edited, we'll need to re-tangle everything. However, nobody has time to do that manually with `C-c C-v t`, *every time*! Luckily, Emacs is highly programmable.
129
130 (defun acdw/tangle-init ()
131 "If the current buffer is `init.org', the code blocks are tangled,
132 and the tangled file is compiled and loaded."
133 (interactive)
134 (when (equal (buffer-file-name)
135 (expand-file-name (concat user-emacs-directory "config.org")))
136 ;; Avoid running hooks when tangling.
137 (let ((prog-mode-hook nil))
138 (org-babel-tangle))))
139
140 (add-hook 'after-save-hook #'acdw/tangle-init)
141
142
143<a id="orgf06a67b"></a>
144
145# Early initiation
146
147Emacs 27.1+ uses `early-init.el`, which is evaluated before things like `package.el` and other stuff. So I have a few settings in there.
148
149
150<a id="org790f346"></a>
151
152## Preamble
153
154Of course, first thing is the modeline. After that, I set `load-prefer-newer` because, well, it *should*.
155
156 ;;; early-init.el -*- lexical-binding: t; no-byte-compile: t -*-
157
158 (setq load-prefer-newer t)
159
160
161<a id="org27a9d06"></a>
162
163## Computers
164
165I have to set these constants before bootstrapping the package manager, since `straight.el` depends on Git, and at work, those are in a weird place.
166
167 (defconst *acdw/at-work* (eq system-type 'windows-nt))
168 (defconst *acdw/at-larry* (string= (system-name) "larry"))
169 (defconst *acdw/at-bax* (string= (system-name) "bax"))
170 (defconst *acdw/at-home* (or *acdw/at-larry* *acdw/at-bax*))
171
172
173<a id="org982c51d"></a>
174
175## Package management
176
177I've started using straight.el, which is great. It grabs packages from git, and apparently will let me fork and edit them, which I'll probably get around to &#x2026; eventually.
178
179
180<a id="org1d43543"></a>
181
182### At work, Git's in a weird place
183
184 (when *acdw/at-work*
185 (add-to-list 'exec-path "~/bin")
186 (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin"))
187
188
189<a id="orgc3c01af"></a>
190
191### [straight.el](https://github.com/raxod502/straight.el)
192
193I don't know why, but for some reason the bootstrapping doesn't work on Windows. I have to download the repo directly from github and put it in the right place (`~/.emacs.d/straight/repos/straight.el/`).
194
195 (defvar bootstrap-version)
196 (let ((bootstrap-file
197 (expand-file-name "straight/repos/straight.el/bootstrap.el"
198 user-emacs-directory))
199 (bootstrap-version 5))
200 (unless (file-exists-p bootstrap-file)
201 (with-current-buffer
202 (url-retrieve-synchronously
203 "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
204 'silent 'inhibit-cookies)
205 (goto-char (point-max))
206 (eval-print-last-sexp)))
207 (load bootstrap-file nil 'nomessage))
208
209
210<a id="org75b502f"></a>
211
212### [use-package](https://github.com/jwiegley/use-package)
213
214Yeah, you know it, I know it, we all love it. It's use-package.
215
216 (setq straight-use-package-by-default t)
217 (straight-use-package 'use-package)
218
219
220<a id="orge258966"></a>
221
222# Begin init.el
223
224 ;;; init.el -*- lexical-binding: t; coding: utf-8 -*-
225 <<tangle-on-save>>
226
227
228<a id="org429e2c9"></a>
229
230# Macros
231
232
233<a id="org98b79c1"></a>
234
235## cuss
236
237I like `use-package`, but I don't like doing the weird "pseudo-package" stuff a lot of people do in their emacs configs. Partially because I have to set `:straight nil` on a lot of built-in packages, but also because I think being *that* obsessive over one interface through the whole config is &#x2026; I don't know, short-sighted?
238
239Either way, I *do* like the `:custom` interface that `use-package` has, so I've re-implemented it in my own macro. This way I don't have to worry about whether to `setq` or `custom-set-variable` or whatever. Just `cuss`!
240
241 (defmacro cuss (var val)
242 "Basically `use-package''s `:custom', but without either."
243 `(progn
244 (funcall (or (get ',var 'custom-set) #'set-default)
245 ',var ,val)))
246
247
248<a id="orgef614d8"></a>
249
250# Files
251
252
253<a id="orgcd98663"></a>
254
255## [Keep .emacs.d tidy](https://github.com/emacscollective/no-littering)
256
257 (straight-use-package 'no-littering)
258 (require 'no-littering)
259
260
261<a id="orgfa8ddd8"></a>
262
263## Customize
264
265I don't like the customize interface, but I still sometimes use it when I'm not sure what the name of a variable is. So I save the stuff to a file, I just don't load it or keep track of it.
266
267 (cuss custom-file (no-littering-expand-etc-file-name "custom.el"))
268
269
270<a id="org7d9d257"></a>
271
272## Encoding
273
274 (prefer-coding-system 'utf-8-unix)
275 (set-default-coding-systems 'utf-8-unix)
276 (set-terminal-coding-system 'utf-8-unix)
277 (set-keyboard-coding-system 'utf-8-unix)
278 (set-selection-coding-system 'utf-8-unix)
279 (set-file-name-coding-system 'utf-8-unix)
280 (set-clipboard-coding-system 'utf-8-unix)
281 (set-buffer-file-coding-system 'utf-8-unix)
282 (cuss locale-coding-system 'utf-8)
283 (cuss x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
284
285
286<a id="org5a20cd6"></a>
287
288## Recent files
289
290 (use-package recentf
291 :config
292 (add-to-list 'recentf-exclude no-littering-var-directory)
293 (add-to-list 'recentf-exclude no-littering-etc-directory)
294 :custom
295 (recentf-max-menu-items 100)
296 (recentf-max-saved-items 100)
297 :config
298 (recentf-mode 1))
299
300
301<a id="org48971aa"></a>
302
303## Backups
304
305 (cuss backup-directory-alist
306 `((".*" . ,(no-littering-expand-var-file-name "backup/"))))
307
308
309<a id="org3243bbe"></a>
310
311## [Autosave](https://github.com/bbatsov/super-save)
312
313 (use-package super-save
314 :custom
315 (auto-save-default nil)
316 (super-save-exclude '(".gpg"))
317 :config
318 (super-save-mode 1))
319
320
321<a id="org1ad3687"></a>
322
323## [Save places](https://www.emacswiki.org/emacs/SavePlace)
324
325 (use-package saveplace
326 :custom
327 (save-place-file (no-littering-expand-var-file-name "places"))
328 (save-place-forget-unreadable-files (not *acdw/at-work*))
329 :config
330 (save-place-mode 1))
331
332
333<a id="orge49f590"></a>
334
335## [Save history](https://www.emacswiki.org/emacs/SaveHist)
336
337 (use-package savehist
338 :custom
339 (savehist-addtional-variables
340 '(kill-ring
341 search-ring
342 regexp-search-ring))
343 (savehist-save-minibuffer-history t)
344 :config
345 (savehist-mode 1))
346
347
348<a id="orgbaf79a4"></a>
349
350# User interface
351
352
353<a id="org57b0df2"></a>
354
355## Look
356
357
358<a id="org7eea925"></a>
359
360### Frames and windows
361
3621. Frame defaults
363
364 (cuss default-frame-alist '((tool-bar-lines . 0)
365 (menu-bar-lines . 0)
366 (vertical-scroll-bars . nil)
367 (horizontal-scroll-bars . nil)
368 (right-divider-width . 2)
369 (bottom-divider-width . 2)
370 (left-fringe-width . 2)
371 (right-fringe-width . 2)))
372
373 ;; also disable these with modes, so I can re-enable them more easily
374 (menu-bar-mode -1)
375 (tool-bar-mode -1)
376 (scroll-bar-mode -1)
377
3782. Resizing
379
380 (cuss frame-resize-pixelwise t)
381 (cuss window-combination-resize t)
382
383
384<a id="orgb767f7c"></a>
385
386### Buffers
387
388 (cuss uniquify-buffer-name-style 'forward)
389
390 (cuss indicate-buffer-boundaries
391 '((top . right)
392 (bottom . right)
393 (t . nil)))
394
3951. Startup buffer
396
397 (cuss inhibit-startup-buffer-menu t)
398 (cuss inhibit-startup-screen t)
399 (cuss initial-buffer-choice t) ; start in *scratch*
400 (cuss initial-scratch-message nil)
401
402
403<a id="org8983905"></a>
404
405### Cursor
406
407 (cuss cursor-type 'bar)
408 (cuss cursor-in-non-selected-windows 'hollow)
409 (blink-cursor-mode 0)
410
411
412<a id="org62c9668"></a>
413
414### Interactivity
415
4161. Mouse
417
418 (cuss mouse-yank-at-point t)
419
4202. Dialogs
421
422 (cuss use-dialog-box nil)
423
4243. Disabled functions
425
426 (cuss disabled-command-function nil)
427
4284. Function aliases
429
430 (fset 'yes-or-no-p #'y-or-n-p)
431
432
433<a id="org1ea822c"></a>
434
435### Miscellaneous
436
4371. Convert `^L` to a line
438
439 (use-package page-break-lines
440 :config
441 (global-page-break-lines-mode 1))
442
443
444<a id="org677f380"></a>
445
446## Themes: [Modus](https://github.com/protesilaos/modus-themes)
447
448 (use-package modus-operandi-theme)
449 (use-package modus-vivendi-theme)
450
451
452<a id="orgb821d6f"></a>
453
454### [Change themes](https://github.com/hadronzoo/theme-changer) based on time of day
455
456 (use-package theme-changer
457 :init
458 (setq calendar-location-name "Baton Rouge, LA"
459 calendar-latitude 30.39
460 calendar-longitude -91.83)
461 :config
462 (change-theme 'modus-operandi 'modus-vivendi))
463
464
465<a id="org5e81fc5"></a>
466
467### Disable the current theme when a theme is interactively loaded
468
469This doesn't happen often, but I'll be ready when it does.
470
471 (defadvice load-theme
472 (before disable-before-load (theme &optional no-confirm no-enable) activate)
473 (mapc 'disable-theme custom-enabled-themes))
474
475
476<a id="org8ab1e2a"></a>
477
478## Modeline: [smart-mode-line](https://github.com/Malabarba/smart-mode-line)
479
480 (use-package smart-mode-line
481 :config
482 (sml/setup))
483
484I hide all minor-modes by default for a clean modeline. However, I can add them back by adding them to the whitelist with `(add-to-list 'rm-whitelist " REGEX")`.
485
486 (defun rm-whitelist-add (regexp)
487 "Add a regexp to the whitelist."
488 (setq rm-whitelist
489 (mapconcat 'identity rm--whitelist-regexps "\\|")))
490
491 (setq rm--whitelist-regexps '("^$"))
492
493 (use-package rich-minority
494 :custom
495 (rm-whitelist
496 (mapconcat 'identity rm--whitelist-regexps "\\|")))
497
498
499<a id="org31ee2e5"></a>
500
501## Fonts
502
503I'm sure there's a better way to do this, but for now, this is the best I've got. I append to the `face-font-family-alternatives` because I don't know what kind of weird magic they're doing in there.
504
505 (cuss face-font-family-alternatives
506 '(("Monospace" "courier" "fixed")
507 ("Monospace Serif" "Courier 10 Pitch" "Consolas" "Courier Std" "FreeMono" "Nimbus Mono L" "courier" "fixed")
508 ("courier" "CMU Typewriter Text" "fixed")
509 ("Sans Serif" "helv" "helvetica" "arial" "fixed")
510 ("helv" "helvetica" "arial" "fixed")
511 ;; now mine
512 ("FixedPitch" "Go Mono" "DejaVu Sans Mono" "Consolas" "fixed")
513 ("VariablePitch" "Go" "DejaVu Sans" "Georgia" "fixed")))
514
515 (set-face-attribute 'default nil
516 :family "FixedPitch"
517 :height 110)
518
519 (set-face-attribute 'fixed-pitch nil
520 :family "FixedPitch"
521 :height 110)
522
523 (set-face-attribute 'variable-pitch nil
524 :family "VariablePitch"
525 :height 130)
526
527
528<a id="org77dea9d"></a>
529
530### Ligatures
531
532These cause big problems with cc-mode (as in, totally freezing everything), so I'm going to comment it out.
533
534 ;; (use-package ligature
535 ;; :straight (ligature
536 ;; :host github
537 ;; :repo "mickeynp/ligature.el")
538 ;; :config
539 ;; (ligature-set-ligatures 'prog-mode
540 ;; '("++" "--" "/=" "&&" "||" "||="
541 ;; "->" "=>" "::" "__"
542 ;; "==" "===" "!=" "=/=" "!=="
543 ;; "<=" ">=" "<=>"
544 ;; "/*" "*/" "//" "///"
545 ;; "\\n" "\\\\"
546 ;; "<<" "<<<" "<<=" ">>" ">>>" ">>="
547 ;; "|=" "^="
548 ;; "**" "--" "---" "----" "-----"
549 ;; "==" "===" "====" "====="
550 ;; "</" "<!--" "</>" "-->" "/>"
551 ;; ":=" "..." ":>" ":<" ">:" "<:"
552 ;; "::=" ;; add others here
553 ;; ))
554 ;; :config
555 ;; (global-ligature-mode))
556
557
558<a id="orgcda6a3b"></a>
559
560### [Unicode fonts](https://github.com/rolandwalker/unicode-fonts)
561
562 (use-package persistent-soft)
563
564 (use-package unicode-fonts
565 :after persistent-soft
566 :config
567 (unicode-fonts-setup))
568
569
570<a id="org14ea5cc"></a>
571
572# Editing
573
574
575<a id="org46827ec"></a>
576
577## Completion
578
579I was using company, but I think it might've been causing issues with `awk-mode`, so I'm trying `hippie-mode` right now. So far, I'm also enjoying not having a popup all the time.
580
581 (bind-key "M-/" #'hippie-expand)
582
583
584<a id="orga788d6a"></a>
585
586## Ignore case
587
588 (cuss completion-ignore-case t)
589 (cuss read-buffer-completion-ignore-case t)
590 (cuss read-file-name-completion-ignore-case t)
591
592
593<a id="org706315a"></a>
594
595## Selection & Minibuffer
596
597
598<a id="org294ff45"></a>
599
600### Selectrum & Prescient
601
602 (use-package selectrum
603 :config
604 (selectrum-mode +1))
605
606 (use-package prescient
607 :config
608 (prescient-persist-mode +1))
609
610 (use-package selectrum-prescient
611 :after (selectrum prescient)
612 :config
613 (selectrum-prescient-mode +1))
614
615
616<a id="org2c0ce4c"></a>
617
618## Search
619
620
621<a id="org2ee70e6"></a>
622
623### CtrlF for searching
624
625 (use-package ctrlf
626 :custom
627 (ctrlf-show-match-count-at-eol nil)
628 :config
629 (ctrlf-mode +1)
630 :bind
631 ("C-s" . ctrlf-forward-regexp))
632
633
634<a id="orgce9fee5"></a>
635
636### [Visual Regexp](https://github.com/benma/visual-regexp.el)
637
638 (use-package visual-regexp
639 :bind
640 ([remap query-replace] . 'vr/query-replace))
641
642
643<a id="orgd0935a4"></a>
644
645## Undo
646
647 (use-package undo-fu
648 :bind
649 ("C-/" . undo-fu-only-undo)
650 ("C-?" . undo-fu-only-redo))
651
652 (use-package undo-fu-session
653 :after no-littering
654 :custom
655 (undo-fu-session-incompatible-files
656 '("/COMMIT_EDITMSG\\'"
657 "/git-rebase-todo\\'"))
658 (undo-fu-session-directory
659 (no-littering-expand-var-file-name "undos/"))
660 :config
661 (global-undo-fu-session-mode +1))
662
663
664<a id="org90fff82"></a>
665
666## Visual editing
667
668
669<a id="orgaf545a8"></a>
670
671### `zap-to-char` replacement
672
673 (use-package zop-to-char
674 :bind
675 ([remap zap-to-char] . zop-to-char)
676 ([remap zap-up-to-char] . zop-up-to-char))
677
678
679<a id="orga6c374d"></a>
680
681### Operate on a line if there's no current region
682
683 (use-package whole-line-or-region
684 :config
685 (whole-line-or-region-global-mode +1))
686
687
688<a id="orgc10cc77"></a>
689
690### Expand-region
691
692 (use-package expand-region
693 :bind
694 ("C-=" . er/expand-region)
695 ("C-+" . er/contract-region))
696
697
698<a id="orge349e7b"></a>
699
700### Volatile highlights
701
702 (use-package volatile-highlights
703 :config
704 (volatile-highlights-mode 1))
705
706
707<a id="org2537d6e"></a>
708
709### Visual line mode
710
711 (global-visual-line-mode 1)
712
713
714<a id="orgb4e6549"></a>
715
716### A better `move-beginning-of-line`
717
718 (defun my/smarter-move-beginning-of-line (arg)
719 "Move point back to indentation of beginning of line.
720
721 Move point to the first non-whitespace character on this line.
722 If point is already there, move to the beginning of the line.
723 Effectively toggle between the first non-whitespace character and
724 the beginning of the line.
725
726 If ARG is not nil or 1, move forward ARG - 1 lines first. If
727 point reaches the beginning or end of the buffer, stop there."
728 (interactive "^p")
729 (setq arg (or arg 1))
730
731 ;; Move lines first
732 (when (/= arg 1)
733 (let ((line-move-visual nil))
734 (forward-line (1- arg))))
735
736 (let ((orig-point (point)))
737 (back-to-indentation)
738 (when (= orig-point (point))
739 (move-beginning-of-line 1))))
740
741 (bind-key "C-a" #'my/smarter-move-beginning-of-line)
742
743
744<a id="orga87bcd4"></a>
745
746## Delete the selection when typing
747
748 (delete-selection-mode 1)
749
750
751<a id="org383042b"></a>
752
753## Clipboard
754
755 (cuss save-interprogram-paste-before-kill t)
756
757
758<a id="orge8f1064"></a>
759
760## Tabs & Spaces
761
762 (cuss indent-tabs-mode nil)
763 (cuss sentence-end-double-space t)
764
765
766<a id="org7ebcef6"></a>
767
768# Programming
769
770
771<a id="org9139ba2"></a>
772
773## Git
774
775 (use-package magit
776 :bind
777 ("C-x g" . magit-status)
778 :config
779 (add-to-list 'magit-no-confirm 'stage-all-changes))
780
781 ;; hook into `prescient'
782 (define-advice magit-list-refs
783 (:around (orig &optional namespaces format sortby)
784 prescient-sort)
785 "Apply prescient sorting when listing refs."
786 (let ((res (funcall orig namespaces format sortby)))
787 (if (or sortby
788 magit-list-refs-sortby
789 (not selectrum-should-sort-p))
790 res
791 (prescient-sort res))))
792
793 (when (executable-find "cmake")
794 (use-package libgit)
795 (use-package magit-libgit))
796
797 (use-package forge
798 :after magit
799 :custom
800 (forge-owned-accounts '(("duckwork"))))
801
802
803<a id="org158c62e"></a>
804
805## Code display
806
807 (add-hook 'prog-mode-hook #'prettify-symbols-mode)
808
809
810<a id="orga6fefd0"></a>
811
812### Parentheses
813
814 (cuss show-paren-style 'mixed)
815 (show-paren-mode +1)
816
817 (use-package smartparens
818 :init
819 (defun acdw/setup-smartparens ()
820 (require 'smartparens-config)
821 (smartparens-mode +1))
822 :hook
823 (prog-mode . acdw/setup-smartparens))
824
825 (use-package rainbow-delimiters
826 :hook
827 (prog-mode . rainbow-delimiters-mode))
828
829
830<a id="orge880bac"></a>
831
832## Line numbers
833
834 (add-hook 'prog-mode-hook
835 (if (and (fboundp 'display-line-numbers-mode)
836 (display-graphic-p))
837 #'display-line-numbers-mode
838 #'linum-mode))
839
840
841<a id="orgd13b98f"></a>
842
843## Languages
844
845
846<a id="org7b82a1d"></a>
847
848### Shell
849
850 (use-package shfmt
851 :custom
852 (shfmt-arguments '("-i" "4" "-ci"))
853 :hook
854 (sh-mode . shfmt-on-save-mode))
855
856 ;; fish
857 (use-package fish-mode)
858
859
860<a id="orgfe2fd7e"></a>
861
862### Lua
863
864 (use-package lua-mode
865 :mode "\\.lua\\'"
866 :interpreter "lua")
867
868
869<a id="org3000823"></a>
870
871### Fennel
872
873 (use-package fennel-mode
874 :mode "\\.fnl\\'")
875
876
877<a id="org38d26c9"></a>
878
879### Web
880
881 (use-package web-mode
882 :custom
883 (web-mode-markup-indent-offset 2)
884 (web-mode-code-indent-offset 2)
885 (web-mode-css-indent-offset 2)
886 :mode (("\\.ts\\'" . web-mode)
887 ("\\.html?\\'" . web-mode)
888 ("\\.css?\\'" . web-mode)
889 ("\\.js\\'" . web-mode)))
890
891
892<a id="org9ae6b0f"></a>
893
894### SSH config
895
896 (use-package ssh-config-mode)
897
898
899<a id="org100f1c7"></a>
900
901# Writing
902
903
904<a id="orgfbddaf6"></a>
905
906## Word count
907
908 (use-package wc-mode
909 :init
910 (rm-whitelist-add "WC")
911 :hook
912 (text-mode . wc-mode))
913
914
915<a id="org32c015a"></a>
916
917## Visual fill column
918
919 (use-package visual-fill-column
920 :custom
921 (split-window-preferred-function 'visual-fill-column-split-window-sensibly)
922 (visual-fill-column-center-text t)
923 (fill-column 100)
924 :config
925 (advice-add 'text-scale-adjust
926 :after #'visual-fill-column-adjust)
927 :hook
928 (org-mode . visual-fill-column-mode))
929
930
931<a id="orgcb552ec"></a>
932
933## Mixed-pitch
934
935 (use-package mixed-pitch
936 :hook
937 (text-mode . mixed-pitch-mode))
938
939
940<a id="org3025d5a"></a>
941
942## Org mode
943
944 (use-package org
945 :custom
946 (org-startup-indented t)
947 (org-src-tab-acts-natively t)
948 (org-hide-emphasis-markers t)
949 (org-fontify-done-headline t)
950 (org-hide-leading-stars t)
951 (org-pretty-entities t)
952 (org-src-window-setup 'current-window))
953
954 (use-package org-superstar
955 :hook
956 (org-mode . org-superstar-mode))
957
958
959<a id="org7eada39"></a>
960
961# Applications
962
963
964<a id="orgc966a52"></a>
965
966## Gemini & Gopher
967
968 (use-package elpher
969 :straight (elpher
970 :repo "git://thelambdalab.xyz/elpher.git")
971 :bind (:map elpher-mode-map
972 ("n" . elpher-next-link)
973 ("p" . elpher-prev-link)
974 ("o" . elpher-follow-current-link)
975 ("G" . elpher-go-current))
976 :hook
977 (elpher-mode . visual-fill-column-mode))
978
979 (use-package gemini-mode
980 :straight (gemini-mode
981 :repo "https://git.carcosa.net/jmcbray/gemini.el.git")
982 :mode "\\.\\(gemini|gmi\\)\\'")
983
984 (use-package gemini-write
985 :straight (gemini-write
986 :repo "https://alexschroeder.ch/cgit/gemini-write"))
987
988 (use-package post-to-gemlog-blue
989 :straight (post-to-gemlog-blue
990 :repo "https://git.sr.ht/~acdw/post-to-gemlog-blue.el"))
991
992
993<a id="orgf849ba8"></a>
994
995## Pastebin
996
997 (use-package 0x0
998 :custom
999 (0x0-default-service 'ttm))
1000
1001
1002<a id="orge75cc1a"></a>
1003
1004## Gnus
1005
1006 (cuss gnus-select-method
1007 '(nnimap "imap.fastmail.com"
1008 (nnimap-inbox "INBOX")
1009 (nnimap-split-methods default)
1010 (nnimap-expunge t)
1011 (nnimap-stream ssl)))
1012
1013 (cuss gnus-secondary-select-methods
1014 '((nntp "news.gwene.org")))
1015
1016
1017<a id="org82ec7aa"></a>
1018
1019## Nov.el: read Ebooks
1020
1021 (use-package nov
1022 :mode ("\\.epub\\'" . nov-mode)
1023 :custom
1024 (nov-text-width t)
1025 :hook
1026 (nov-mode . visual-line-mode)
1027 (nov-mode . visual-fill-column-mode))
1028
1029
1030<a id="orga88ef69"></a>
1031
1032# Machine-specific configurations
1033
1034 (cond
1035 (*acdw/at-home*
1036 (use-package su
1037 :config
1038 (su-mode 1))
1039 (use-package trashed
1040 :custom
1041 (delete-by-moving-to-trash t))
1042 (use-package exec-path-from-shell
1043 :demand
1044 :config
1045 (exec-path-from-shell-initialize)))
1046 )
1047