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.md466
1 files changed, 207 insertions, 259 deletions
diff --git a/README.md b/README.md index 9e0e26d..b4e10ba 100644 --- a/README.md +++ b/README.md
@@ -80,7 +80,6 @@ when it errors.
80 '(use-package-custom-update 80 '(use-package-custom-update
81 :host github 81 :host github
82 :repo "a13/use-package-custom-update")) 82 :repo "a13/use-package-custom-update"))
83
84 (require 'use-package-custom-update) 83 (require 'use-package-custom-update)
85 84
86 85
@@ -103,19 +102,26 @@ when it errors.
103 102
104## Keep a tidy `~/.emacs` 103## Keep a tidy `~/.emacs`
105 104
106 (use-package no-littering 105 (straight-use-package 'no-littering)
107 :custom 106
108 (backup-directory-alist 107 (cuss backup-directory-alist `((".*" . ,(no-littering-expand-var-file-name "backup/")))
109 `((".*" . ,(no-littering-expand-var-file-name "backup/")))) 108 "Where to store backup files.")
110 (auto-save-file-name-transforms 109
111 `((".*" ,(no-littering-expand-var-file-name "autosaves/") t))) 110 (cuss auto-save-file-name-transforms
112 (save-place-file 111 `((".*" ,(no-littering-expand-var-file-name "autosaves/") t))
113 (no-littering-expand-var-file-name "places")) 112 "Where to store auto-save files.")
114 (undo-fu-session-directory
115 (no-littering-expand-var-file-name "undos/"))
116 (elpher-certificate-directory
117 (no-littering-expand-var-file-name "elpher-certificates/")))
118 113
114 (cuss save-place-file (no-littering-expand-var-file-name "places")
115 "Where to store place files.")
116
117 (cuss undo-fu-session-directory (no-littering-expand-var-file-name "undos/")
118 "Where to store undo information.")
119
120 (cuss elpher-certificate-directory
121 (no-littering-expand-var-file-name "elpher-certificates/")
122 "Where to store elpher client certificates.")
123
124 ;; Make all directories defined above
119 (dolist (dir '("backup" 125 (dolist (dir '("backup"
120 "autosaves" 126 "autosaves"
121 "undos" 127 "undos"
@@ -140,7 +146,6 @@ when it errors.
140 (cuss default-frame-alist 146 (cuss default-frame-alist
141 '((tool-bar-lines . 0) 147 '((tool-bar-lines . 0)
142 (menu-bar-lines . 0))) 148 (menu-bar-lines . 0)))
143
144 (menu-bar-mode -1) 149 (menu-bar-mode -1)
145 (tool-bar-mode -1) 150 (tool-bar-mode -1)
146 151
@@ -149,7 +154,6 @@ when it errors.
149 154
150 (add-to-list 'default-frame-alist '(vertical-scroll-bars . nil)) 155 (add-to-list 'default-frame-alist '(vertical-scroll-bars . nil))
151 (scroll-bar-mode -1) 156 (scroll-bar-mode -1)
152
153 (add-to-list 'default-frame-alist '(horizontal-scroll-bars . nil)) 157 (add-to-list 'default-frame-alist '(horizontal-scroll-bars . nil))
154 (horizontal-scroll-bar-mode -1) 158 (horizontal-scroll-bar-mode -1)
155 159
@@ -167,7 +171,6 @@ when it errors.
167### Remove the bell 171### Remove the bell
168 172
169 (cuss visible-bell (not (string= (system-name) "larry"))) 173 (cuss visible-bell (not (string= (system-name) "larry")))
170
171 (defun acdw/ring-bell-function () 174 (defun acdw/ring-bell-function ()
172 "Custom bell-ringing function." 175 "Custom bell-ringing function."
173 (let ((orig-face (face-foreground 'mode-line))) 176 (let ((orig-face (face-foreground 'mode-line)))
@@ -177,7 +180,6 @@ when it errors.
177 (lambda (fg) 180 (lambda (fg)
178 (set-face-foreground 'mode-line fg)) 181 (set-face-foreground 'mode-line fg))
179 orig-face))) 182 orig-face)))
180
181 (cuss ring-bell-function #'acdw/ring-bell-function) 183 (cuss ring-bell-function #'acdw/ring-bell-function)
182 184
183 185
@@ -204,7 +206,6 @@ when it errors.
204 '((width . 80) 206 '((width . 80)
205 (height . 2) 207 (height . 2)
206 (vertical-scrollbars . nil))) 208 (vertical-scrollbars . nil)))
207
208 (set-window-scroll-bars (minibuffer-window) nil nil) 209 (set-window-scroll-bars (minibuffer-window) nil nil)
209 210
2102. Keep the cursor from going into the prompt 2112. Keep the cursor from going into the prompt
@@ -243,43 +244,15 @@ when it errors.
243### Buffer boundaries 244### Buffer boundaries
244 245
245 (cuss indicate-buffer-boundaries 246 (cuss indicate-buffer-boundaries
246 '((top . right) 247 '((up . right)
247 (bottom . right) 248 (down . right)
248 (t . nil))) 249 (t . nil)))
249
250 (cuss indicate-empty-lines t) 250 (cuss indicate-empty-lines t)
251 251
252 252
253## Windows 253## Windows
254 254
255 255
256### Split windows *more* sensibly
257
258from [Stack Overflow](https://stackoverflow.com/questions/23659909/reverse-evaluation-order-of-split-height-threshold-and-split-width-threshold-in).
259
260 (defun my-split-window-sensibly (&optional window)
261 (let ((window (or window (selected-window))))
262 (or (and (window-splittable-p window t)
263 ;; Split window horizontally.
264 (with-selected-window window
265 (split-window-right)))
266 (and (window-splittable-p window)
267 ;; Split window vertically.
268 (with-selected-window window
269 (split-window-below)))
270 (and (eq window (frame-root-window (window-frame window)))
271 (not (window-minibuffer-p window))
272 ;; If WINDOW is the only window on its frame and is not the
273 ;; minibuffer window, try to split it horizontally disregarding
274 ;; the value of `split-width-threshold'.
275 (let ((split-width-threshold 0))
276 (when (window-splittable-p window t)
277 (with-selected-window window
278 (split-window-right))))))))
279
280 (setq split-window-preferred-function #'my-split-window-sensibly)
281
282
283### Winner mode 256### Winner mode
284 257
285 (when (fboundp 'winner-mode) 258 (when (fboundp 'winner-mode)
@@ -338,40 +311,40 @@ from [link0ff](https://github.com/link0ff/emacs-init).
338 311
339## Theme 312## Theme
340 313
341 (use-package modus-themes 314 (straight-use-package '(modus-themes
342 :straight (modus-themes 315 :host gitlab
343 :host gitlab 316 :repo "protesilaos/modus-themes"
344 :repo "protesilaos/modus-themes" 317 :branch "main"))
345 :branch "main") 318
346 :custom 319 (cuss modus-themes-slanted-constructs t)
347 (modus-themes-slanted-constructs t) 320 (cuss modus-themes-bold-constructs t)
348 (modus-themes-bold-constructs t) 321 (cuss modus-themes-fringes nil)
349 (modus-themes-fringes nil) 322 (cuss modus-themes-mode-line '3d)
350 (modus-themes-mode-line '3d) 323 (cuss modus-themes-syntax 'yellow-comments)
351 (modus-themes-syntax 'yellow-comments) 324 (cuss modus-themes-intense-hl-line nil)
352 (modus-themes-intense-hl-line nil) 325 (cuss modus-themes-paren-match 'intense-bold)
353 (modus-themes-paren-match 'intense-bold) 326 (cuss modus-themes-links nil)
354 (modus-themes-links nil) 327 (cuss modus-themes-no-mixed-fonts nil)
355 (modus-themes-no-mixed-fonts nil) 328 (cuss modus-themes-prompts nil)
356 (modus-themes-prompts nil) 329 (cuss modus-themes-completions nil)
357 (modus-themes-completions nil) 330 (cuss modus-themes-diffs nil)
358 (modus-themes-diffs nil) 331 (cuss modus-themes-org-blocks 'grayscale)
359 (modus-themes-org-blocks 'grayscale) 332 (cuss modus-themes-headings
360 (modus-themes-headings 333 '((1 . line)
361 '((1 . line) 334 (t . t)))
362 (t . t))) 335 (cuss modus-themes-variable-pitch-headings t)
363 (modus-themes-variable-pitch-headings t) 336 (cuss modus-themes-scale-headings t)
364 (modus-themes-scale-headings t) 337 (cuss modus-themes-scale-1 1.1)
365 (modus-themes-scale-1 1.1) 338 (cuss modus-themes-scale-2 1.15)
366 (modus-themes-scale-2 1.15) 339 (cuss modus-themes-scale-3 1.21)
367 (modus-themes-scale-3 1.21) 340 (cuss modus-themes-scale-4 1.27)
368 (modus-themes-scale-4 1.27) 341 (cuss modus-themes-scale-5 1.33)
369 (modus-themes-scale-5 1.33) 342
370 :custom-face 343 ;; :custom-face
371 (font-lock-comment-face 344 (custom-set-faces `(font-lock-comment-face
372 ((t (:inherit (custom-comment italic variable-pitch))))) 345 ((t (:inherit (custom-comment italic variable-pitch))))))
373 :init 346
374 (load-theme 'modus-operandi t)) 347 (load-theme 'modus-operandi t)
375 348
376 349
377### Change theme based on time of day 350### Change theme based on time of day
@@ -379,19 +352,35 @@ from [link0ff](https://github.com/link0ff/emacs-init).
379 (cuss calendar-latitude 30.4515) 352 (cuss calendar-latitude 30.4515)
380 (cuss calendar-longitude -91.1871) 353 (cuss calendar-longitude -91.1871)
381 354
382 (use-package circadian 355 (straight-use-package 'circadian)
383 :custom 356
384 (circadian-themes '((:sunrise . modus-operandi) 357 (cuss circadian-themes '((:sunrise . modus-operandi)
385 (:sunset . modus-vivendi))) 358 (:sunset . modus-vivendi)))
386 :config 359
387 (circadian-setup)) 360 (circadian-setup)
388 361
389 362
390### Modeline 363### Modeline
391 364
392 (use-package mood-line 365 (straight-use-package 'smart-mode-line)
393 :config 366 (cuss sml/no-confirm-load-theme t)
394 (mood-line-mode +1)) 367 (sml/setup)
368
3691. Rich minority
370
371 Since this *comes* with smart mode line, I’m just going to use it, instead of `diminish` or another package. I do have to write this helper function, though, to add things to the whitelist.
372
373 (defun rm/whitelist-add (regexp)
374 "Add a REGEXP to the whitelist for `rich-minority'."
375 (if (listp 'rm--whitelist-regexps)
376 (add-to-list 'rm--whitelist-regexps regexp)
377 (setq rm--whitelist-regexps `(,regexp)))
378 (setq rm-whitelist
379 (mapconcat 'identity rm--whitelist-regexps "\\|")))
380
381 (straight-use-package 'rich-minority)
382
383 (rm/whitelist-add "^$")
395 384
396 385
397### Fonts 386### Fonts
@@ -422,25 +411,22 @@ from [link0ff](https://github.com/link0ff/emacs-init).
422 :height 100) 411 :height 100)
423 ("Consolas" 412 ("Consolas"
424 :height 100))) 413 :height 100)))
425
426 (set-face-from-alternatives 'fixed-pitch 414 (set-face-from-alternatives 'fixed-pitch
427 '(("Libertinus Mono" 415 '(("Libertinus Mono"
428 :height 1.0) 416 :height 110)
429 ("Linux Libertine Mono O" 417 ("Linux Libertine Mono O"
430 :height 1.0) 418 :height 110)
431 ("Go Mono" 419 ("Go Mono"
432 :height 1.0) 420 :height 100)
433 ("Consolas" 421 ("Consolas"
434 :height 1.0))) 422 :height 100)))
435
436 (set-face-from-alternatives 'variable-pitch 423 (set-face-from-alternatives 'variable-pitch
437 '(("Libertinus Serif" 424 '(("Libertinus Serif"
438 :height 1.0) 425 :height 120)
439 ("Linux Libertine O" 426 ("Linux Libertine O"
440 :height 1.0) 427 :height 120)
441 ("Georgia" 428 ("Georgia"
442 :height 1.0))) 429 :height 110)))
443
444 (remove-function after-focus-change-function #'acdw/setup-fonts))) 430 (remove-function after-focus-change-function #'acdw/setup-fonts)))
445 431
446 (add-function :before after-focus-change-function #'acdw/setup-fonts) 432 (add-function :before after-focus-change-function #'acdw/setup-fonts)
@@ -455,8 +441,8 @@ from [link0ff](https://github.com/link0ff/emacs-init).
455 441
4564. Unicode fonts 4424. Unicode fonts
457 443
458 (use-package unicode-fonts 444 (straight-use-package 'unicode-fonts)
459 :config 445 (with-eval-after-load 'unicode-fonts
460 (unicode-fonts-setup)) 446 (unicode-fonts-setup))
461 447
462 448
@@ -465,11 +451,9 @@ from [link0ff](https://github.com/link0ff/emacs-init).
465 451
466## Async 452## Async
467 453
468 (use-package async) 454 (straight-use-package 'async)
469
470 (autoload 'dired-async-mode "dired-async.el" nil t) 455 (autoload 'dired-async-mode "dired-async.el" nil t)
471 (dired-async-mode +1) 456 (dired-async-mode +1)
472
473 (async-bytecomp-package-mode +1) 457 (async-bytecomp-package-mode +1)
474 458
475 459
@@ -478,29 +462,36 @@ from [link0ff](https://github.com/link0ff/emacs-init).
478 462
479### Shadow file names 463### Shadow file names
480 464
481 (cuss file-name-shadow-properties 465 (cuss file-name-shadow-properties '(invisible t))
482 '(invisible t))
483 466
484 (file-name-shadow-mode +1) 467 (file-name-shadow-mode +1)
485 468
486 469
487### Selectrum 470### Selectrum
488 471
489 (use-package selectrum 472 (straight-use-package 'selectrum)
490 :config 473 (require 'selectrum)
491 (selectrum-mode +1)) 474 (selectrum-mode +1)
492 475
493 476
494### Prescient 477### Prescient
495 478
496 (use-package prescient 479 (straight-use-package 'prescient)
497 :config 480 (require 'prescient)
498 (prescient-persist-mode +1))
499 481
500 (use-package selectrum-prescient 482 (prescient-persist-mode +1)
501 :after (selectrum prescient) 483
502 :config 484 (straight-use-package 'selectrum-prescient)
503 (selectrum-prescient-mode +1)) 485
486 (with-eval-after-load 'prescient
487 (with-eval-after-load 'selectrum
488 (selectrum-prescient-mode +1)))
489
490 (straight-use-package 'company-prescient)
491
492 (with-eval-after-load 'prescient
493 (with-eval-after-load 'company
494 (company-prescient-mode +1)))
504 495
505 496
506### Consult 497### Consult
@@ -520,7 +511,6 @@ from [link0ff](https://github.com/link0ff/emacs-init).
520 ("<help> a" . consult-apropos)) 511 ("<help> a" . consult-apropos))
521 :init 512 :init
522 (fset 'multi-occur #'consult-multi-occur)) 513 (fset 'multi-occur #'consult-multi-occur))
523
524 (use-package consult-selectrum 514 (use-package consult-selectrum
525 :straight (consult-selectrum 515 :straight (consult-selectrum
526 :host github 516 :host github
@@ -529,19 +519,19 @@ from [link0ff](https://github.com/link0ff/emacs-init).
529 519
530### Marginalia 520### Marginalia
531 521
532 (use-package marginalia 522 (straight-use-package '(marginalia
533 :straight (marginalia 523 :host github
534 :host github 524 :repo "minad/marginalia"
535 :repo "minad/marginalia" 525 :branch "main"))
536 :branch "main") 526
537 :init 527 (cuss marginalia-annotators
538 (marginalia-mode +1) 528 (if (eq system-type 'windows-nt)
539 (cuss marginalia-annotators 529 '(marginalia-annotators-light
540 (if (eq system-type 'windows-nt) 530 marginalia-annotators-heavy)
541 '(marginalia-annotators-light 531 '(marginalia-annotators-heavy
542 marginalia-annotators-heavy) 532 marginalia-annotators-light)))
543 '(marginalia-annotators-heavy 533
544 marginalia-annotators-light)))) 534 (marginalia-mode +1)
545 535
546 536
547## Ignore case 537## Ignore case
@@ -595,21 +585,21 @@ From [link0ff](https://github.com/link0ff/emacs-init). I thought they made a gr
595 585
596Also from link0ff. See the above for a link. 586Also from link0ff. See the above for a link.
597 587
598 (defvar my-map 588 (defvar acdw/map
599 (let ((map (make-sparse-keymap)) 589 (let ((map (make-sparse-keymap))
600 (c-z (global-key-binding "\C-z"))) 590 (c-z (global-key-binding "\C-z")))
601 (global-unset-key "\C-z") 591 (global-unset-key "\C-z")
602 (define-key global-map "\C-z" map) 592 (define-key global-map "\C-z" map)
603 (define-key map "\C-z" c-z) 593 (define-key map "\C-z" c-z)
604 map)) 594 map))
605 (run-hooks 'my-map-defined-hook) 595 (run-hooks 'acdw/map-defined-hook)
606 596
607 597
608### Which-key 598### Which-key
609 599
610 (use-package which-key 600 (straight-use-package 'which-key)
611 :config 601
612 (which-key-mode +1)) 602 (which-key-mode +1)
613 603
614 604
615### Bindings 605### Bindings
@@ -630,11 +620,8 @@ Also from link0ff. See the above for a link.
630 '(kill-ring 620 '(kill-ring
631 search-ring 621 search-ring
632 regexp-search-ring)) 622 regexp-search-ring))
633
634 (cuss savehist-save-minibuffer-history t) 623 (cuss savehist-save-minibuffer-history t)
635
636 (cuss history-length t) 624 (cuss history-length t)
637
638 (cuss history-delete-duplicates t) 625 (cuss history-delete-duplicates t)
639 626
640 (savehist-mode +1) 627 (savehist-mode +1)
@@ -656,7 +643,6 @@ Also from link0ff. See the above for a link.
656 643
657 (cuss recentf-max-menu-items 100) 644 (cuss recentf-max-menu-items 100)
658 (cuss recentf-max-saved-items 100) 645 (cuss recentf-max-saved-items 100)
659
660 (with-eval-after-load 'no-littering 646 (with-eval-after-load 'no-littering
661 (add-to-list 'recentf-exclude no-littering-var-directory) 647 (add-to-list 'recentf-exclude no-littering-var-directory)
662 (add-to-list 'recentf-exclude no-littering-etc-directory)) 648 (add-to-list 'recentf-exclude no-littering-etc-directory))
@@ -683,13 +669,13 @@ Also from link0ff. See the above for a link.
683 ("C-/" . undo-fu-only-undo) 669 ("C-/" . undo-fu-only-undo)
684 ("C-?" . undo-fu-only-redo)) 670 ("C-?" . undo-fu-only-redo))
685 671
686 (use-package undo-fu-session 672 (straight-use-package 'undo-fu-session)
687 :custom 673
688 (undo-fu-session-incompatible-files 674 (cuss undo-fu-session-incompatible-files
689 '("/COMMIT_EDITMSG\\'" 675 '("/COMMIT_EDITMSG\\'"
690 "/git-rebase-todo\\'")) 676 "/git-rebase-todo\\'"))
691 :config 677
692 (global-undo-fu-session-mode +1)) 678 (global-undo-fu-session-mode +1)
693 679
694 680
695# Editing 681# Editing
@@ -748,11 +734,11 @@ Also from link0ff. See the above for a link.
748 734
749## Highlight modified regions 735## Highlight modified regions
750 736
751 (use-package goggles 737 (straight-use-package 'goggles)
752 :custom 738
753 (goggles-pulse nil) 739 (cuss goggles-pulse nil)
754 :config 740
755 (goggles-mode +1)) 741 (goggles-mode +1)
756 742
757 743
758# Files 744# Files
@@ -776,10 +762,10 @@ Also from link0ff. See the above for a link.
776from [Emacs Wiki](https://www.emacswiki.org/emacs/EndOfLineTips). 762from [Emacs Wiki](https://www.emacswiki.org/emacs/EndOfLineTips).
777 763
778 (defun ewiki/no-junk-please-were-unixish () 764 (defun ewiki/no-junk-please-were-unixish ()
779 "Convert line endings to UNIX, dammit." 765 "Convert line endings to UNIX, dammit."
780 (let ((coding-str (symbol-name buffer-file-coding-system))) 766 (let ((coding-str (symbol-name buffer-file-coding-system)))
781 (when (string-match "-\\(?:dos\\|mac\\)$" coding-str) 767 (when (string-match "-\\(?:dos\\|mac\\)$" coding-str)
782 (set-buffer-file-coding-system 'unix)))) 768 (set-buffer-file-coding-system 'unix))))
783 769
784I add it to the `find-file-hook` *and* `before-save-hook` because I don't want to ever work with anything other than UNIX line endings ever again. I just don't care. Even Microsoft Notepad can handle UNIX line endings, so I don't want to hear it. 770I add it to the `find-file-hook` *and* `before-save-hook` because I don't want to ever work with anything other than UNIX line endings ever again. I just don't care. Even Microsoft Notepad can handle UNIX line endings, so I don't want to hear it.
785 771
@@ -837,36 +823,20 @@ I add it to the `find-file-hook` *and* `before-save-hook` because I don't want t
837 823
838### Smart parentheses 824### Smart parentheses
839 825
840 (use-package smartparens 826 (straight-use-package 'smartparens)
841 :init 827 (require 'smartparens-config)
842 (require 'smartparens-config)
843 :config
844 (show-smartparens-global-mode +1)
845 :hook
846 (prog-mode-hook . smartparens-strict-mode))
847
848
849## Line numbers
850
851 (defun acdw/enable-line-numbers ()
852 "Enable line numbers, through either
853 `display-line-numbers-mode' or through `linum-mode'."
854 (if (and (fboundp 'display-line-numbers-mode)
855 (display-graphic-p))
856 (display-line-numbers-mode +1)
857 (linum-mode +1)))
858 828
859 (cuss display-line-numbers-width 2 829 (show-smartparens-global-mode +1)
860 "Always have at least 2 digits for line numbers.") 830 (add-to-list 'sp-ignore-modes-list 'org-mode)
861 831
862 (add-hook 'prog-mode-hook #'acdw/enable-line-numbers) 832 (add-hook 'prog-mode-hook #'smartparens-strict-mode)
863 833
864 834
865## Indenting 835## Indenting
866 836
867 (use-package aggressive-indent 837 (straight-use-package 'aggressive-indent)
868 :config 838
869 (global-aggressive-indent-mode +1)) 839 (global-aggressive-indent-mode +1)
870 840
871 841
872## Completion 842## Completion
@@ -875,30 +845,23 @@ I add it to the `find-file-hook` *and* `before-save-hook` because I don't want t
875 :custom 845 :custom
876 (company-idle-delay 0.1) 846 (company-idle-delay 0.1)
877 (company-minimum-prefix-length 3) 847 (company-minimum-prefix-length 3)
878
879 :init 848 :init
880 (defun acdw/company-complete-common-or-cycle+1 () 849 (defun acdw/company-complete-common-or-cycle+1 ()
881 (interactive) 850 (interactive)
882 (company-complete-common-or-cycle +1)) 851 (company-complete-common-or-cycle +1))
883
884 (defun acdw/company-complete-common-or-cycle-1 () 852 (defun acdw/company-complete-common-or-cycle-1 ()
885 (interactive) 853 (interactive)
886 (company-complete-common-or-cycle -1)) 854 (company-complete-common-or-cycle -1))
887
888 :bind 855 :bind
889 (:map company-active-map 856 (:map company-active-map
890 ("C-n" . acdw/company-complete-common-or-cycle+1) 857 ("C-n" . acdw/company-complete-common-or-cycle+1)
891 ("C-p" . acdw/company-complete-common-or-cycle-1)) 858 ("C-p" . acdw/company-complete-common-or-cycle-1))
892
893 :hook 859 :hook
894 (prog-mode-hook . company-mode)) 860 (prog-mode-hook . company-mode))
895
896 (use-package company-prescient 861 (use-package company-prescient
897 :hook 862 :hook
898 (company-mode-hook . company-prescient-mode)) 863 (company-mode-hook . company-prescient-mode))
899
900 ;; this comes with company-quickhelp, so.... 864 ;; this comes with company-quickhelp, so....
901
902 (use-package company-posframe 865 (use-package company-posframe
903 :after (company) 866 :after (company)
904 :config 867 :config
@@ -934,24 +897,24 @@ I add it to the `find-file-hook` *and* `before-save-hook` because I don't want t
934 897
935## Visual Fill Column 898## Visual Fill Column
936 899
937 (use-package visual-fill-column 900 (straight-use-package 'visual-fill-column)
938 :custom 901
939 (split-window-preferred-function 902 (cuss split-window-preferred-function
940 'visual-fill-column-split-window-sensibly) 903 'visual-fill-column-split-window-sensibly)
941 (visual-fill-column-center-text t) 904 (cuss visual-fill-column-center-text t)
942 (fill-column 80) 905 (cuss fill-column 80)
943 :config 906
944 (advice-add 'text-scale-adjust 907 (advice-add 'text-scale-adjust
945 :after #'visual-fill-column-adjust) 908 :after #'visual-fill-column-adjust)
946 :hook 909
947 (text-mode-hook . visual-fill-column-mode)) 910 (add-hook 'text-mode-hook #'visual-fill-column-mode)
948 911
949 912
950## Type nice-looking quote-type marks 913## Type nice-looking quote-type marks
951 914
952 (use-package typo 915 (straight-use-package 'typo)
953 :hook 916
954 (text-mode-hook . typo-mode)) 917 (add-hook 'text-mode-hook #'typo-mode)
955 918
956 919
957## Insert *kaomoji* 920## Insert *kaomoji*
@@ -968,44 +931,37 @@ I add it to the `find-file-hook` *and* `before-save-hook` because I don't want t
968 931
969 (use-package magit 932 (use-package magit
970 :bind 933 :bind
971 ("C-x g" . magit-status)) 934 ("C-z g" . magit-status))
972 935
973 936
974## Org mode 937## Org mode
975 938
976I’ve put org mode under Applications, as opposed to Writing, because it’s more generally-applicable than that. 939I’ve put org mode under Applications, as opposed to Writing, because it’s more generally-applicable than that.
977 940
978 (use-package org 941 (straight-use-package 'org)
979 :mode ("\\.org\\'" . org-mode)
980
981 :bind (:map org-mode-map
982 ("M-n" . outline-next-visible-heading)
983 ("M-p" . outline-previous-visible-heading))
984
985 :custom
986 (org-hide-emphasis-markers t)
987 (org-fontify-done-headline t)
988 (org-fontify-whole-heading-line t)
989 (org-fontify-quote-and-verse-blocks t)
990 (org-pretty-entities t)
991 (org-num-mode +1)
992
993 (cuss org-directory "~/Org")
994 942
995 (org-src-tab-acts-natively t) 943 (with-eval-after-load 'org
996 (org-src-fontify-natively t)
997 (org-src-window-setup 'current-window)
998 (org-confirm-babel-evaluate nil)
999
1000 :config
1001 (require 'org-tempo) 944 (require 'org-tempo)
1002 (require 'ox-md)) 945 (require 'ox-md)
946 (bind-key "M-n" #'outline-next-visible-heading 'org-mode-map)
947 (bind-key "M-p" #'outline-previous-visible-heading 'org-mode-map))
948
949 (cuss org-hide-emphasis-markers t)
950 (cuss org-fontify-done-headline t)
951 (cuss org-fontify-whole-heading-line t)
952 (cuss org-fontify-quote-and-verse-blocks t)
953 (cuss org-pretty-entities t)
954 (cuss org-num-mode +1)
955 (cuss org-src-tab-acts-natively t)
956 (cuss org-src-fontify-natively t)
957 (cuss org-src-window-setup 'current-window)
958 (cuss org-confirm-babel-evaluate nil)
959 (cuss org-directory "~/Org")
1003 960
1004 961
1005### Org Agenda 962### Org Agenda
1006 963
1007 (cuss org-agenda-files (no-littering-expand-etc-file-name "agenda-files")) 964 (cuss org-agenda-files (no-littering-expand-etc-file-name "agenda-files"))
1008
1009 (if (and (stringp org-agenda-files) 965 (if (and (stringp org-agenda-files)
1010 (not (file-exists-p org-agenda-files))) 966 (not (file-exists-p org-agenda-files)))
1011 (with-temp-buffer (write-file org-agenda-files))) 967 (with-temp-buffer (write-file org-agenda-files)))
@@ -1025,7 +981,6 @@ I’ve put org mode under Applications, as opposed to Writing, because it’s m
1025### [A better return in Org mode](http://kitchingroup.cheme.cmu.edu/blog/2017/04/09/A-better-return-in-org-mode/) 981### [A better return in Org mode](http://kitchingroup.cheme.cmu.edu/blog/2017/04/09/A-better-return-in-org-mode/)
1026 982
1027 (require 'org-inlinetask) 983 (require 'org-inlinetask)
1028
1029 (defun scimax/org-return (&optional ignore) 984 (defun scimax/org-return (&optional ignore)
1030 "Add new list item, heading or table row with RET. 985 "Add new list item, heading or table row with RET.
1031 A double return on an empty element deletes it. 986 A double return on an empty element deletes it.
@@ -1034,25 +989,20 @@ I’ve put org mode under Applications, as opposed to Writing, because it’s m
1034 (if ignore 989 (if ignore
1035 (org-return) 990 (org-return)
1036 (cond 991 (cond
1037
1038 ((eq 'line-break (car (org-element-context))) 992 ((eq 'line-break (car (org-element-context)))
1039 (org-return t)) 993 (org-return t))
1040
1041 ;; Open links like usual, unless point is at the end of a line. 994 ;; Open links like usual, unless point is at the end of a line.
1042 ;; and if at beginning of line, just press enter. 995 ;; and if at beginning of line, just press enter.
1043 ((or (and (eq 'link (car (org-element-context))) (not (eolp))) 996 ((or (and (eq 'link (car (org-element-context))) (not (eolp)))
1044 (bolp)) 997 (bolp))
1045 (org-return)) 998 (org-return))
1046
1047 ;; It doesn't make sense to add headings in inline tasks. Thanks Anders 999 ;; It doesn't make sense to add headings in inline tasks. Thanks Anders
1048 ;; Johansson! 1000 ;; Johansson!
1049 ((org-inlinetask-in-task-p) 1001 ((org-inlinetask-in-task-p)
1050 (org-return)) 1002 (org-return))
1051
1052 ;; checkboxes too 1003 ;; checkboxes too
1053 ((org-at-item-checkbox-p) 1004 ((org-at-item-checkbox-p)
1054 (org-insert-todo-heading nil)) 1005 (org-insert-todo-heading nil))
1055
1056 ;; lists end with two blank lines, so we need to make sure we are also not 1006 ;; lists end with two blank lines, so we need to make sure we are also not
1057 ;; at the beginning of a line to avoid a loop where a new entry gets 1007 ;; at the beginning of a line to avoid a loop where a new entry gets
1058 ;; created with only one blank line. 1008 ;; created with only one blank line.
@@ -1062,7 +1012,6 @@ I’ve put org mode under Applications, as opposed to Writing, because it’s m
1062 (beginning-of-line) 1012 (beginning-of-line)
1063 (delete-region (line-beginning-position) (line-end-position)) 1013 (delete-region (line-beginning-position) (line-end-position))
1064 (org-return))) 1014 (org-return)))
1065
1066 ;; org-heading 1015 ;; org-heading
1067 ((org-at-heading-p) 1016 ((org-at-heading-p)
1068 (if (not (string= "" (org-element-property :title (org-element-context)))) 1017 (if (not (string= "" (org-element-property :title (org-element-context))))
@@ -1072,7 +1021,6 @@ I’ve put org mode under Applications, as opposed to Writing, because it’s m
1072 (beginning-of-line) 1021 (beginning-of-line)
1073 (setf (buffer-substring 1022 (setf (buffer-substring
1074 (line-beginning-position) (line-end-position)) ""))) 1023 (line-beginning-position) (line-end-position)) "")))
1075
1076 ;; tables 1024 ;; tables
1077 ((org-at-table-p) 1025 ((org-at-table-p)
1078 (if (-any? 1026 (if (-any?
@@ -1086,12 +1034,9 @@ I’ve put org mode under Applications, as opposed to Writing, because it’s m
1086 (setf (buffer-substring 1034 (setf (buffer-substring
1087 (line-beginning-position) (line-end-position)) "") 1035 (line-beginning-position) (line-end-position)) "")
1088 (org-return))) 1036 (org-return)))
1089
1090 ;; fall-through case 1037 ;; fall-through case
1091 (t 1038 (t
1092 (org-return))))) 1039 (org-return)))))
1093
1094
1095 (define-key org-mode-map (kbd "RET") 1040 (define-key org-mode-map (kbd "RET")
1096 'scimax/org-return) 1041 'scimax/org-return)
1097 1042
@@ -1142,10 +1087,16 @@ from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lin
1142 (when (eq major-mode 'org-mode) 1087 (when (eq major-mode 'org-mode)
1143 (let ((current-prefix-arg 4)) ; Emulate C-u 1088 (let ((current-prefix-arg 4)) ; Emulate C-u
1144 (call-interactively 'unpackaged/org-fix-blank-lines)))) 1089 (call-interactively 'unpackaged/org-fix-blank-lines))))
1145
1146 (add-hook 'before-save-hook #'cribbed/org-mode-fix-blank-lines) 1090 (add-hook 'before-save-hook #'cribbed/org-mode-fix-blank-lines)
1147 1091
1148 1092
1093### Agenda
1094
1095 (bind-key "C-a" #'org-agenda 'acdw/map)
1096 (cuss org-agenda-files
1097 '("~/todo.org"))
1098
1099
1149## Elpher 1100## Elpher
1150 1101
1151 (use-package elpher 1102 (use-package elpher
@@ -1225,9 +1176,9 @@ from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lin
1225 1176
1226## Pastebin 1177## Pastebin
1227 1178
1228 (use-package 0x0 1179 (straight-use-package '0x0)
1229 :custom 1180
1230 (0x0-default-service 'ttm)) 1181 (cuss 0x0-default-service 'ttm)
1231 1182
1232 1183
1233## RSS 1184## RSS
@@ -1259,12 +1210,10 @@ from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lin
1259from [karthinks](https://karthinks.com/software/more-batteries-included-with-emacs/#regexp-builder--m-x-re-builder). 1210from [karthinks](https://karthinks.com/software/more-batteries-included-with-emacs/#regexp-builder--m-x-re-builder).
1260 1211
1261 (require 'browse-url) 1212 (require 'browse-url)
1262
1263 (when (executable-find "mpv") 1213 (when (executable-find "mpv")
1264 (defun browse-url-mpv (url &optional single) 1214 (defun browse-url-mpv (url &optional single)
1265 (start-process "mpv" nil (if single "mpv" "umpv") 1215 (start-process "mpv" nil (if single "mpv" "umpv")
1266 (shell-quote-wildcard-pattern url))) 1216 (shell-quote-wildcard-pattern url)))
1267
1268 (defun browse-url-at-point-mpv (&optional single) 1217 (defun browse-url-at-point-mpv (&optional single)
1269 "Open a link in mpv." 1218 "Open a link in mpv."
1270 (interactive "P") 1219 (interactive "P")
@@ -1275,7 +1224,6 @@ from [karthinks](https://karthinks.com/software/more-batteries-included-with-ema
1275 (browse-url-mpv url t)) 1224 (browse-url-mpv url t))
1276 #'browse-url-mpv))) 1225 #'browse-url-mpv)))
1277 (browse-url-at-point))) 1226 (browse-url-at-point)))
1278
1279 (cuss browse-url-browser-function 1227 (cuss browse-url-browser-function
1280 '(("https?:\\/\\/www\\.youtu\\.*be." . browse-url-mpv) 1228 '(("https?:\\/\\/www\\.youtu\\.*be." . browse-url-mpv)
1281 ("." . browse-url-generic)))) 1229 ("." . browse-url-generic))))
@@ -1289,7 +1237,8 @@ from [karthinks](https://karthinks.com/software/more-batteries-included-with-ema
1289 (defun acdw/setup-nov-mode () 1237 (defun acdw/setup-nov-mode ()
1290 (visual-line-mode +1) 1238 (visual-line-mode +1)
1291 (visual-fill-column-mode +1) 1239 (visual-fill-column-mode +1)
1292 (variable-pitch-mode +1)) 1240 (variable-pitch-mode +1)
1241 (setq cursor-type nil))
1293 :config 1242 :config
1294 (cuss nov-text-width t) 1243 (cuss nov-text-width t)
1295 :hook 1244 :hook
@@ -1299,13 +1248,16 @@ from [karthinks](https://karthinks.com/software/more-batteries-included-with-ema
1299## Eshell 1248## Eshell
1300 1249
1301 (when (executable-find "bash") 1250 (when (executable-find "bash")
1302 (use-package bash-completion)) 1251 (straight-use-package 'bash-completion))
1303 1252
1304 (when (executable-find "fish") 1253 (when (executable-find "fish")
1305 (use-package fish-completion 1254 (straight-use-package 'fish-completion)
1306 :config 1255 (require 'fish-completion)
1307 (cuss fish-completion-fallback-on-bash-p (executable-find "bash")) 1256 (cuss fish-completion-fallback-on-bash-p (executable-find "bash"))
1308 (global-fish-completion-mode +1))) 1257 (global-fish-completion-mode +1)
1258
1259 (straight-use-package 'fish-mode)
1260 (add-to-list 'auto-mode-alist '("\\.fish\\'" . fish-mode)))
1309 1261
1310 1262
1311# Appendices 1263# Appendices
@@ -1347,9 +1299,9 @@ from [karthinks](https://karthinks.com/software/more-batteries-included-with-ema
1347### early-init.el 1299### early-init.el
1348 1300
1349 ;; early-init.el -*- lexical-binding: t; no-byte-compile: t; -*- 1301 ;; early-init.el -*- lexical-binding: t; no-byte-compile: t; -*-
1350 1302
1351 (setq load-prefer-newer t) 1303 (setq load-prefer-newer t)
1352 (setq frame-inhibit-implied-resize t) 1304 (setq frame-inhibit-implied-resize t)
1353 1305
1354 1306
1355## Ease tangling and loading of Emacs' init 1307## Ease tangling and loading of Emacs' init
@@ -1384,7 +1336,6 @@ from [karthinks](https://karthinks.com/software/more-batteries-included-with-ema
1384 1336
1385 (defun acdw/refresh-emacs-no-load () 1337 (defun acdw/refresh-emacs-no-load ()
1386 (refresh-emacs 'disable-load)) 1338 (refresh-emacs 'disable-load))
1387
1388 (add-hook 'kill-emacs-hook #'acdw/refresh-emacs-no-load) 1339 (add-hook 'kill-emacs-hook #'acdw/refresh-emacs-no-load)
1389 1340
1390 1341
@@ -1393,7 +1344,7 @@ from [karthinks](https://karthinks.com/software/more-batteries-included-with-ema
1393 1344
1394### emacsdc 1345### emacsdc
1395 1346
1396A wrapper script around emacs-client that starts the daemon if it hasn’t been yet. 1347Here’s a wrapper script that’ll start `emacs –daemon` if there isn’t one, and then launch `emacsclient` with the arguments. I’d recommend installing with either `ln -s bin/emacsdc $HOME/.local/bin/`, or adding `$HOME/.local/bin` to your `$PATH`.
1397 1348
1398 if ! emacsclient -nc "$@" 2>/dev/null; then 1349 if ! emacsclient -nc "$@" 2>/dev/null; then
1399 emacs --daemon 1350 emacs --daemon
@@ -1404,7 +1355,6 @@ A wrapper script around emacs-client that starts the daemon if it hasn’t been
1404## License 1355## License
1405 1356
1406Copyright © 2020 Case Duckworth <acdw@acdw.net> 1357Copyright © 2020 Case Duckworth <acdw@acdw.net>
1407
1408This work is free. You can redistribute it and/or modify it under the 1358This work is free. You can redistribute it and/or modify it under the
1409terms of the Do What the Fuck You Want To Public License, Version 2, 1359terms of the Do What the Fuck You Want To Public License, Version 2,
1410as published by Sam Hocevar. See the `LICENSE` file, tangled from the 1360as published by Sam Hocevar. See the `LICENSE` file, tangled from the
@@ -1420,7 +1370,6 @@ following source block, for details.
1420 this license document, and changing it is allowed as long as the name is changed. 1370 this license document, and changing it is allowed as long as the name is changed.
1421 1371
1422 DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 1372 DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
1423
1424 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 1373 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
1425 1374
1426 0. You just DO WHAT THE FUCK YOU WANT TO. 1375 0. You just DO WHAT THE FUCK YOU WANT TO.
@@ -1430,6 +1379,5 @@ following source block, for details.
1430 1379
1431It's highly likely that the WTFPL is completely incompatible with the 1380It's highly likely that the WTFPL is completely incompatible with the
1432GPL, for what should be fairly obvious reasons. To that, I say: 1381GPL, for what should be fairly obvious reasons. To that, I say:
1433
1434**SUE ME, RMS!** 1382**SUE ME, RMS!**
1435 1383