about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--LICENSE15
-rw-r--r--README.org15
-rw-r--r--early-init.el57
-rw-r--r--init.el603
5 files changed, 418 insertions, 276 deletions
diff --git a/.gitignore b/.gitignore index a2ba0f5..993a79e 100644 --- a/.gitignore +++ b/.gitignore
@@ -1,4 +1,6 @@
1* 1*
2!early-init.el 2!early-init.el
3!init.el 3!init.el
4!.gitignore \ No newline at end of file 4!.gitignore
5!README.org
6!LICENSE
diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b61f756 --- /dev/null +++ b/LICENSE
@@ -0,0 +1,15 @@
1DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
3Version 2, December 2004
4
5Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
6
7Everyone is permitted to copy and distribute verbatim or modified copies of
8this license document, and changing it is allowed as long as the name is changed.
9
10DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11
12TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
13
14 0. You just DO WHAT THE FUCK YOU WANT TO.
15
diff --git a/README.org b/README.org new file mode 100644 index 0000000..1f03531 --- /dev/null +++ b/README.org
@@ -0,0 +1,15 @@
1* my =emacs.d=
2
3hey. I use emacs now.
4
5this is my =~/.emacs.d=.
6
7I was going to use Org-mode but .. I decided not to.
8
9
10* License
11
12WTFPL. For more info, see =LICENSE=.
13
14Probably that's not legal under the terms of the GPL or whatever Emacs is licensed under.
15SUE ME, RMS
diff --git a/early-init.el b/early-init.el index e7595a9..5fd600f 100644 --- a/early-init.el +++ b/early-init.el
@@ -1,47 +1,47 @@
1;;; early-init.el ~ acdw 1;;; early-init.el ~ acdw -*- lexical-binding: t; coding: utf-8; fill-column: 85 -*-
2 2
3;;; this needs to happen first -- speed up init 3;;; Commentary:
4;; `early-init.el' is new as of Emacs 27.1. It contains ... /early initiation/.
5;; What does that mean? Who knows. What I /do know/ is that it runs /before/
6;; `package.el' is loaded, so I can stop it from loading, since I use `straight.el'.
7;; Other than that, there's some other init stuff that needs to happen as early
8;; as possible -- think bootstrap-level.
9
10;;; Speed up startup
4(setq gc-cons-threshold most-positive-fixnum) 11(setq gc-cons-threshold most-positive-fixnum)
12
5(defvar file-name-handler-alist-old file-name-handler-alist) 13(defvar file-name-handler-alist-old file-name-handler-alist)
6(setq file-name-handler-alist nil) 14(setq file-name-handler-alist nil)
15
7(setq message-log-max 16384) 16(setq message-log-max 16384)
8(setq byte-compile-warnings 17(setq byte-compile-warnings
9 '(not free-vars unresolved noruntime lexical make-local)) 18 '(not free-vars unresolved noruntime lexical make-local))
10 19
20;;; Restore stuff after startup
11(add-hook 'after-init-hook 21(add-hook 'after-init-hook
12 (lambda () 22 (lambda ()
13 (setq file-name-handler-alist file-name-handler-alist-old) 23 (setq file-name-handler-alist file-name-handler-alist-old)
14 (setq gc-cons-threshold (* 32 1024 1024))) 24 (setq gc-cons-threshold (* 32 1024 1024))
25 (garbage-collect))
15 t) 26 t)
16 27
17;;(setq debug-on-error t) 28;; (setq debug-on-error t)
18 29
19;;; different platforms 30;;; Define the platforms I work on
20(defconst *acdw/at-work* (eq system-type 'windows-nt)) 31(defconst *acdw/at-work* (eq system-type 'windows-nt))
21(defconst *acdw/at-larry* (string= (system-name) "larry")) 32(defconst *acdw/at-larry* (string= (system-name) "larry"))
22(defconst *acdw/at-bax* (string= (system-name) "bax")) 33(defconst *acdw/at-bax* (string= (system-name) "bax"))
23(defconst *acdw/at-home* (or *acdw/at-larry* *acdw/at-bax*)) 34(defconst *acdw/at-home* (or *acdw/at-larry* *acdw/at-bax*))
24 35
25;; this needs to be before bootstrapping straight.el 36;;;; When at work, I have to use Portable Git.
26(when *acdw/at-work* 37(when *acdw/at-work*
27 (add-to-list 'exec-path "~/bin") 38 (add-to-list 'exec-path "~/bin")
28 (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin")) 39 (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin"))
29 40
30;;; gui 41;;; `straight.el' ~ github.com/raxod502/straight.el
31(add-to-list 'default-frame-alist '(tool-bar-lines . 0))
32(add-to-list 'default-frame-alist '(menu-bar-lines . 0))
33
34(setq inhibit-startup-buffer-menu t)
35(setq inhibit-startup-screen t)
36(setq initial-buffer-choice t)
37(setq initial-scratch-message nil)
38 42
39;;; straight.el ~ github.com/raxod502/straight.el 43;;;; Bootstrap
40 44;; NOTE: this doesn't work on Windows (download straight directly)
41(setq straight-use-package-by-default t) ; use use-package
42(setq use-package-hook-name-suffix nil) ; don't assume -hook
43
44;; bootstrap
45(defvar bootstrap-version) 45(defvar bootstrap-version)
46(let ((bootstrap-file 46(let ((bootstrap-file
47 (expand-file-name "straight/repos/straight.el/bootstrap.el" 47 (expand-file-name "straight/repos/straight.el/bootstrap.el"
@@ -49,12 +49,19 @@
49 (bootstrap-version 5)) 49 (bootstrap-version 5))
50 (unless (file-exists-p bootstrap-file) 50 (unless (file-exists-p bootstrap-file)
51 (with-current-buffer 51 (with-current-buffer
52 (url-retrieve-synchronously 52 (url-retrieve-synchronously
53 "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" 53 "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
54 'silent 'inhibit-cookies) 54 'silent 'inhibit-cookies)
55 (goto-char (point-max)) 55 (goto-char (point-max))
56 (eval-print-last-sexp))) 56 (eval-print-last-sexp)))
57 (load bootstrap-file nil 'nomessage)) 57 (load bootstrap-file nil 'nomessage))
58 58
59;; install use-package with straight 59;;; Bootstrap `use-package'
60(setq-default use-package-verbose nil
61 use-package-expand-minimally t
62 use-package-enable-imenu-support t
63 use-package-hook-name-suffix nil)
64
60(straight-use-package 'use-package) 65(straight-use-package 'use-package)
66
67(setq straight-use-package-by-default t)
diff --git a/init.el b/init.el index fc7eae7..bafdda2 100644 --- a/init.el +++ b/init.el
@@ -1,231 +1,247 @@
1;;; init.el ~ acdw -*- lexical-binding: t -*- 1;;; init.el -*- lexical-binding: t; coding: utf-8; fill-column: 70 -*-
2 2
3;;; emacs configuration - general 3;;; Commentary:
4 4;; I /was/ going to convert this to org-mode, but then I found this
5;; page: https://yiufung.net/post/pure-emacs-lisp-init-skeleton/,
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
8;; what I'm doing.
9;;; Basic emacs config & built-in packages
10;;;; /Really/ basic emacs config
11;; I /did/ use `better-defaults', but it turns out that that package
12;; is (a) short and (b) mostly overriden by other settings.
5(use-package emacs 13(use-package emacs
6 :demand 14 :demand ; make sure this stuff loads
7 :init 15 :init
16 ;; where I am
8 (setq calendar-location-name "Baton Rouge, LA") 17 (setq calendar-location-name "Baton Rouge, LA")
9 (setq calendar-latitude 30.39) 18 (setq calendar-latitude 30.39)
10 (setq calendar-longitude -91.83) 19 (setq calendar-longitude -91.83)
11 20
12 (setq browse-url-browser-function 'browse-url-generic) 21 ;; firefox is love, firefox is life
13 (setq browse-url-generic-program "firefox")) 22 (setq browse-url-browser-function 'browse-url-firefox
23 browse-url-new-window-flag t
24 browse-url-firefox-new-window-is-tab t)
14 25
15(use-package no-littering 26 ;; honestly not sure if this is necessary
16 :config 27 (autoload 'zap-up-to-char "misc"
17 (require 'recentf) 28 "Kill up to, but not including, ARGth occurence of CHAR." t)
18 (add-to-list 'recentf-exclude no-littering-var-directory)
19 (add-to-list 'recentf-exclude no-littering-etc-directory)
20 29
21 (setq delete-old-versions t) 30 ;; show parentheses
22 (setq kept-new-versions 6) 31 (setq show-paren-style 'mixed)
23 (setq kept-old-versions 2) 32 (show-paren-mode)
24 (setq version-control t)
25 (setq backup-directory-alist
26 `((".*" . ,(no-littering-expand-var-file-name "backup/"))))
27 33
28 (setq auto-save-file-name-transforms 34 ;; always work on visual lines
29 `((".*" ,(no-littering-expand-var-file-name "auto-save/") t))) 35 (global-visual-line-mode)
30 (auto-save-mode)
31 36
32 (setq custom-file (no-littering-expand-etc-file-name "custom.el")) 37 ;; make the mouse avoid where I'm typing
38 (mouse-avoidance-mode 'jump)
33 39
34 (setq create-lockfiles nil)) 40 ;; delete the selection when I start typing, like a normal editor
41 (delete-selection-mode)
35 42
36(use-package auth-source 43 ;; ignore case
37 :init 44 (setq-default completion-ignore-case t
38 (setq auth-sources '("~/.authinfo")) ;; TODO: gpg 45 read-buffer-completion-ignore-case t
39 (setq user-full-name "Case Duckworth") 46 read-file-name-completion-ignore-case t)
40 (setq user-mail-address "acdw@acdw.net"))
41 47
42(use-package better-defaults 48 ;; etc defaults
43 :demand 49 (fset 'yes-or-no-p 'y-or-n-p)
44 :config ; add other "better defaults" of my own 50 (setq-default indent-tabs-mode nil
51 save-interprogram-paste-before-kill t
52 apropos-do-all t
53 mouse-yank-at-point t
54 require-final-newline t
55 visible-bell (not *acdw/at-larry*)
56 ediff-window-setup-function 'ediff-setup-windows-plain
57 use-dialog-box nil
58 mark-even-if-inactive nil
59 sentence-end-double-space t)
60
61 ;; utf-8 is now, old man
62 (set-charset-priority 'unicode)
63 (set-language-environment "UTF-8")
64 (set-default-coding-systems 'utf-8)
65 (set-terminal-coding-system 'utf-8)
66 (set-keyboard-coding-system 'utf-8)
67 (set-selection-coding-system 'utf-8)
68 (prefer-coding-system 'utf-8)
69 (setq default-buffer-file-coding-system 'utf-8
70 default-process-coding-system '(utf-8-unix . utf-8-unix)
71 locale-coding-system 'utf-8)
72
73 ;; don't confirm killing
74 (setq confirm-kill-processes nil
75 confirm-kill-emacs nil)
76
77 ;; simplify the GUI
78 (setq default-frame-alist '((tool-bar-lines . 0)
79 (menu-bar-lines . 0)
80 (vertical-scroll-bars . nil)
81 (horizontal-scroll-bars . nil)
82 (right-divider-width . 2)
83 (bottom-divider-width . 2)
84 (left-fringe-width . 2)
85 (right-fringe-width . 2))
86 inhibit-startup-buffer-menu t
87 inhibit-startup-screen t
88 initial-buffer-choice t
89 initial-scratch-message nil)
90
91 ;; When at larry, fullscreen emacs.
45 (when *acdw/at-larry* 92 (when *acdw/at-larry*
46 (setq visible-bell nil)) 93 (add-to-list 'default-frame-alist '(fullscreen . maximized)))
47 94
48 (auto-save-mode) 95 ;; set up the cursor
96 (blink-cursor-mode 0)
97 (setq-default cursor-type 'bar
98 cursor-in-non-selected-windows 'hollow)
49 99
50 (defun full-auto-save () 100 ;; display line numbers in `prog-mode'
51 (interactive) 101 (add-hook 'prog-mode-hook
52 (save-excursion 102 (if (and (fboundp 'display-line-numbers-mode)
53 (dolist (buf (buffer-list)) 103 (display-graphic-p))
54 (set-buffer buf) 104 #'display-line-numbers-mode
55 (if (and (buffer-file-name) (buffer-modified-p)) 105 #'linum-mode))
56 (basic-save-buffer)))))
57 (add-hook 'auto-save-hook 'full-auto-save)
58 (add-hook 'focus-out-hook 'full-auto-save) ; might be resource-intensive
59 106
60 ;; follow the split! 107 ;; custom functions
61 (defun split-and-follow-below () 108 (defun split-and-follow-below ()
109 "Split the window below and switch to the split."
62 (interactive) 110 (interactive)
63 (split-window-below) 111 (split-window-below)
64 (balance-windows) 112 (balance-windows)
65 (other-window 1)) 113 (other-window 1))
66 114
67 (defun split-and-follow-right () 115 (defun split-and-follow-right ()
116 "Split the window right and switch to the split."
68 (interactive) 117 (interactive)
69 (split-window-right) 118 (split-window-right)
70 (balance-windows) 119 (balance-windows)
71 (other-window 1)) 120 (other-window 1))
72 121
73 (setq save-place-file (no-littering-expand-var-file-name "places")) 122 (defun full-auto-save ()
74 (save-place-mode) 123 "Save all buffers that (a) have files associated and (b) are modified."
75 124 (interactive)
76 (set-language-environment "UTF-8") 125 (save-excursion
77 (prefer-coding-system 'utf-8) 126 (dolist (buf (buffer-list))
78 (set-default-coding-systems 'utf-8) 127 (set-buffer buf)
79 (set-terminal-coding-system 'utf-8) 128 (if (and (buffer-file-name) (buffer-modified-p))
80 (set-keyboard-coding-system 'utf-8) 129 (basic-save-buffer)))))
81 (setq default-buffer-file-coding-system 'utf-8)
82
83 (fset 'yes-or-no-p 'y-or-n-p)
84
85 (global-visual-line-mode)
86 (mouse-avoidance-mode 'jump)
87 (setq show-paren-style 'mixed)
88 (delete-selection-mode 1)
89
90 ;; TODO figure out how to add this to the :hook block
91 (add-hook 'prog-mode-hook (if (and (fboundp 'display-line-numbers-mode)
92 (display-graphic-p))
93 #'display-line-numbers-mode
94 #'linum-mode))
95
96 (setq completion-ignore-case t)
97 (setq read-buffer-completion-ignore-case t)
98 (setq read-file-name-completion-ignore-case t)
99
100 ;; don't confirm death
101 (setq confirm-kill-processes nil)
102 (setq confirm-kill-emacs nil)
103 130
104 ;; cursor betterment 131 (defun kill-this-buffer ()
105 (blink-cursor-mode 0) 132 "Kill the current buffer."
106 (setq-default cursor-type 'bar) 133 (interactive)
134 (kill-buffer nil))
107 135
108 :bind 136 :bind
137 ("C-x C-b" . ibuffer)
138 ("M-z" . zap-up-to-char)
109 ([remap split-window-below] . split-and-follow-below) 139 ([remap split-window-below] . split-and-follow-below)
110 ([remap split-window-right] . split-and-follow-right) 140 ([remap split-window-right] . split-and-follow-right)
141 ("C-x f" . find-file)
142 ("C-z" . nil)
143 ("C-x k" . kill-this-buffer)
144 ("C-x K" . kill-buffer)
111 145
112 :hook 146 :hook
113 (prog-mode-hook . prettify-symbols-mode) 147 (prog-mode-hook . prettify-symbols-mode)
114 (auto-save-hook . full-auto-save) 148 ((auto-save-hook focus-out-hook) . full-auto-save)
115 (focus-out-hook . full-auto-save)
116 (before-save-hook . delete-trailing-whitespace)) 149 (before-save-hook . delete-trailing-whitespace))
117 150
118(use-package async 151;;;; Keep .emacs.d clean
152;; load this early for other packages to use
153(use-package no-littering
154 :demand
119 :config 155 :config
120 (dired-async-mode 1)) 156 (setq custom-file (no-littering-expand-etc-file-name "custom.el"))
121 157
122(use-package auto-compile 158 (setq create-lockfiles nil)
123 :config
124 (auto-compile-on-load-mode)
125 (setq load-prefer-newer t))
126 159
127;; start the server when at home 160 (setq delete-old-versions t
161 kept-new-versions 6
162 kept-old-versions 2
163 version-control t)
128 164
129(if *acdw/at-home* 165 (setq backup-directory-alist
130 (server-start)) 166 `((".*" . ,(no-littering-expand-var-file-name "backup/"))))
131 167
132;;; quality-of-life improvements 168 (setq auto-save-file-name-transforms
169 `((".*" ,(no-littering-expand-var-file-name "auto-save/") t)))
170 (auto-save-mode))
133 171
134(use-package diminish) 172;;;; Uniquily name buffers
173(use-package uniquify
174 :straight nil
175 :init
176 (setq uniquify-buffer-name-style 'forward))
135 177
136(use-package which-key 178;;;; Use async when possible
137 :diminish which-key-mode 179(use-package async
138 :config 180 :config
139 (which-key-mode)) 181 (dired-async-mode))
182
183;;;; Autocompile elisp files (like this one)
184(use-package auto-compile
185 :init
186 (setq load-prefer-newer t)
187 :config
188 (auto-compile-on-load-mode))
140 189
190;;;; Recent files
141(use-package recentf 191(use-package recentf
142 :init 192 :init
143 (setq recentf-max-menu-items 100) 193 (setq recentf-max-menu-items 100
144 (setq recentf-max-saved-items 100) 194 recentf-max-saved-items 100)
145 :config 195 :config
196 (add-to-list 'recentf-exclude no-littering-var-directory)
197 (add-to-list 'recentf-exclude no-littering-etc-directory)
146 (recentf-mode)) 198 (recentf-mode))
199;;;; Save places in files
200(use-package saveplace
201 :init
202 (setq save-place-file (no-littering-expand-var-file-name "places"))
203 (when *acdw/at-work*
204 (setq save-place-forget-unreadable-files nil))
205 :config
206 (save-place-mode))
147 207
208;;;; Save history of commands, etc.
148(use-package savehist 209(use-package savehist
149 :config 210 :init
150 (savehist-mode)
151 (setq savehist-additional-variables 211 (setq savehist-additional-variables
152 '(kill-ring search-ring regexp-search-ring))) 212 '(kill-ring
153 213 search-ring
154(use-package restart-emacs) 214 regexp-search-ring))
155
156(use-package volatile-highlights
157 :config
158 (volatile-highlights-mode t))
159
160(use-package zop-to-char
161 :bind
162 ([remap zap-to-char] . zop-to-char)
163 ([remap zap-up-to-char] . zop-up-to-char))
164
165(use-package easy-kill
166 :bind
167 ([remap kill-ring-save] . easy-kill)
168 ([remap mark-sexp] . easy-mark))
169
170(use-package whole-line-or-region
171 :config
172 (whole-line-or-region-global-mode 1))
173
174(use-package avy
175 :bind
176 ("M-s" . avy-goto-char-timer))
177
178(use-package selectrum
179 :config
180 (ido-mode -1) ;; not sure why this is necessary
181 (setq enable-recursive-minibuffers t)
182 (minibuffer-depth-indicate-mode)
183 (selectrum-mode 1))
184
185(use-package prescient)
186
187(use-package selectrum-prescient
188 :config
189 (selectrum-prescient-mode 1)
190 (prescient-persist-mode 1))
191
192(use-package ctrlf
193 :config 215 :config
194 (ctrlf-mode 1)) 216 (savehist-mode))
195 217
196;;; programming 218;;;; Authority sources for logins
197 219;; TODO: use gpg
198(use-package aggressive-indent 220(use-package auth-source
199 :diminish aggressive-indent-mode 221 :init
200 :hook 222 (setq auth-sources '("~/.authinfo"))
201 (prog-mode-hook . aggressive-indent-mode)) 223 (setq user-full-name "Case Duckworth")
224 (setq user-mail-address "acdw@acdw.net"))
202 225
203(use-package magit 226;;; General-ish Packages
204 :if *acdw/at-home* 227;;;; General improvements
205 :bind 228;;;;; Diminish TODO: is this necessary?
206 ("C-x g" . magit)) 229(use-package diminish)
207 230
208(use-package forge 231;;;;; Restart emacs /from within/ emacs
209 :if *acdw/at-home* 232(use-package restart-emacs)
210 :after magit
211 :custom
212 (forge-owned-accounts '(("duckwork"))))
213 233
214(use-package company 234;;;; User interface
215 :commands company-mode 235;;;;; Pop-up help for keys
236(use-package which-key
237 :diminish which-key-mode
216 :init 238 :init
217 (setq company-idle-delay 0.1) 239 (setq which-key-enable-extended-define-key t)
218 :hook
219 (prog-mode-hook . company-mode)
220 :bind (:map company-active-map
221 ("C-n" . company-select-next)
222 ("C-p" . company-select-previous))
223 :config 240 :config
224 (use-package company-quickhelp 241 (which-key-setup-side-window-right-bottom)
225 :hook 242 (which-key-mode))
226 (company-mode-hook . (lambda ()
227 (company-quickhelp-local-mode)))))
228 243
244;;;;; A better help buffer
229(use-package helpful 245(use-package helpful
230 :bind 246 :bind
231 ("C-h f" . helpful-callable) 247 ("C-h f" . helpful-callable)
@@ -235,40 +251,37 @@
235 ("C-h F" . helpful-function) 251 ("C-h F" . helpful-function)
236 ("C-h C" . helpful-command)) 252 ("C-h C" . helpful-command))
237 253
238(when *acdw/at-home* 254;;;;; A better `outline-mode'
239 (use-package su 255(use-package outshine
240 :config 256 :init
241 (su-mode)) 257 (setq outshine-cycle-emulate-tab t)
242 258 :bind (:map outshine-mode-map
243 (use-package trashed 259 ("<S-iso-lefttab>" . outshine-cycle-buffer)
244 :init 260 ("<backtab>" . outshine-cycle-buffer))
245 (setq delete-by-moving-to-trash t)))
246
247(use-package smartparens
248 :config
249 (require 'smartparens-config)
250 (smartparens-global-mode))
251
252(use-package rainbow-mode
253 :hook 261 :hook
254 (prog-mode-hook . rainbow-mode)) 262 (emacs-lisp-mode-hook: . outshine-mode))
255 263
256(use-package slime 264;;;;; Item selection & narrowing
265(use-package selectrum
257 :init 266 :init
258 (setq inferior-lisp-program "/usr/bin/sbcl")) 267 (setq enable-recursive-minibuffers t)
268 (minibuffer-depth-indicate-mode)
269 :config
270 (selectrum-mode))
259 271
260;;; writing 272(use-package prescient)
261 273
262(use-package visual-fill-column 274(use-package selectrum-prescient
263 :init
264 (setq split-window-preferred-function 'visual-fill-column-split-window-sensibly)
265 (setq visual-fill-column-center-text t)
266 :config 275 :config
267 (advice-add 'text-scale-adjust 276 (selectrum-prescient-mode)
268 :after #'visual-fill-column-adjust)) 277 (prescient-persist-mode))
269 278
270;;; window management 279;;;;; Searching
280(use-package ctrlf
281 :config
282 (ctrlf-mode))
271 283
284;;;;; Visually switch windows
272(use-package switch-window 285(use-package switch-window
273 :init 286 :init
274 (setq switch-window-shortcut-style 'qwerty) 287 (setq switch-window-shortcut-style 'qwerty)
@@ -276,37 +289,20 @@
276 ([remap other-window] . switch-window) 289 ([remap other-window] . switch-window)
277 ("s-o" . switch-window)) 290 ("s-o" . switch-window))
278 291
279;;; theming and looks 292;;;; Theming, looks, fonts
280 293;;;;; Modeline
281(use-package dynamic-fonts
282 :init
283 (setq dynamic-fonts-preferred-monospace-fonts
284 '("Iosevka Term Slab"
285 "Consolas"
286 "Fira Code"
287 "DejaVu Sans Mono"
288 "Courier"
289 "Fixed"))
290 (setq dynamic-fonts-preferred-monospace-point-size 11)
291 (setq dynamic-fonts-preferred-proportional-fonts
292 '("DejaVu Sans"
293 "Georgia"
294 "Times New Roman"
295 "Times"))
296 (setq dynamic-fonts-preferred-proportional-point-size 12)
297 :config
298 (dynamic-fonts-setup))
299
300(use-package doom-modeline 294(use-package doom-modeline
301 :init 295 :init
302 (setq doom-modeline-icon nil) 296 (setq doom-modeline-icon nil
303 (setq doom-modeline-enable-word-count t) 297 doom-modeline-enable-word-count t)
298
304 (when *acdw/at-larry* 299 (when *acdw/at-larry*
305 (setq display-time-format "%R") 300 (setq display-time-format "%R")
306 (display-time-mode)) 301 (display-time-mode))
307 :hook
308 (after-init-hook . doom-modeline-mode))
309 302
303 :hook
304 (window-setup-hook . doom-modeline-mode))
305;;;;; Ligatures
310(use-package ligature 306(use-package ligature
311 :straight (ligature 307 :straight (ligature
312 :host github 308 :host github
@@ -327,14 +323,12 @@
327 ":=" "..." ":>" ":<" ">:" "<:" 323 ":=" "..." ":>" ":<" ">:" "<:"
328 "::=" ;; add others here 324 "::=" ;; add others here
329 )) 325 ))
330 (global-ligature-mode t)) 326 (global-ligature-mode))
331 327;;;;; Unicode
332(use-package unicode-fonts 328(use-package unicode-fonts
333 :config 329 :config
334 (unicode-fonts-setup)) 330 (unicode-fonts-setup))
335 331;;;;; Modus themes
336;; modus themes
337
338(use-package modus-operandi-theme 332(use-package modus-operandi-theme
339 :if window-system 333 :if window-system
340 :config 334 :config
@@ -362,8 +356,131 @@
362 (run-at-time (nth 4 (split-string (sunrise-sunset))) 356 (run-at-time (nth 4 (split-string (sunrise-sunset)))
363 (* 60 60 24) #'acdw/sunset) 357 (* 60 60 24) #'acdw/sunset)
364 (run-at-time "12am" (* 60 60 24) #'acdw/sunset))) 358 (run-at-time "12am" (* 60 60 24) #'acdw/sunset)))
359;;;; General text editing
360;;;;; Jump to characters fast
361(use-package avy
362 :bind
363 ("M-s" . avy-goto-char-timer))
364;;;;; Show text commands acted on
365(use-package volatile-highlights
366 :config
367 (volatile-highlights-mode))
368;;;;; Visual replacement for `zap-to-char'
369(use-package zop-to-char
370 :bind
371 ([remap zap-to-char] . zop-to-char)
372 ([remap zap-up-to-char] . zop-up-to-char))
373;;;;; Kill & mark things more visually
374(use-package easy-kill
375 :bind
376 ([remap kill-ring-save] . easy-kill)
377 ([remap mark-sexp] . easy-mark))
378;;;;; Operate on the current line if no region is active
379(use-package whole-line-or-region
380 :config
381 (whole-line-or-region-global-mode))
382
383;;;;; Expand region
384(use-package expand-region
385 :bind
386 ("C-=" . er/expand-region))
387;;;; Programming
388;;;;; Code completion
389(use-package company
390 :init
391 (setq company-idle-delay 0.1
392 company-show-numbers t)
393 :config
394 (let ((map company-active-map))
395 (mapc (lambda (x)
396 (define-key map (format "%d" x)
397 `(lambda ()
398 (interactive)
399 (company-complete-number ,x))))
400 (number-sequence 0 9)))
401 :hook
402 (prog-mode-hook . company-mode)
403 :bind (:map company-active-map
404 ("C-n" . company-select-next)
405 ("C-p" . company-select-previous)))
406
407(use-package company-quickhelp
408 :hook
409 (company-mode-hook . company-quickhelp-local-mode))
410
411(use-package company-prescient
412 :hook
413 (company-mode-hook . company-prescient-mode))
414
415;;;;; Git integration
416(use-package magit
417 :if *acdw/at-home*
418 :bind
419 ("C-x g" . magit-status)
420 :config
421 (add-to-list 'magit-no-confirm 'stage-all-changes))
422
423;; use libgit to speed up magit, only at home
424(when (and *acdw/at-home* (executable-find "cmake"))
425 (use-package libgit)
365 426
366;;; gemini/gopher 427 (use-package magit-libgit
428 :after (magit libgit))
429 )
430
431(use-package forge
432 :if *acdw/at-home*
433 :after magit
434 :config
435 (setq forge-owned-accounts '(("duckwork"))))
436;;;;; Code formatting & display
437;;;;;; Keep code properly indented
438(use-package aggressive-indent
439 :diminish aggressive-indent-mode
440 :hook
441 (prog-mode-hook . aggressive-indent-mode))
442;;;;;; Smartly deal with pairs
443(use-package smartparens
444 :config
445 (require 'smartparens-config)
446 (smartparens-global-mode))
447;;;;;; Show delimiters as different colors
448(use-package rainbow-delimiters
449 :hook
450 (prog-mode-hook . rainbow-delimiters-mode))
451;;;;;; Show colors as they appear in the buffer
452(use-package rainbow-mode
453 :hook
454 (prog-mode-hook . rainbow-mode))
455;;;; Writing
456;;;;; `fill-column', but in `visual-line-mode'
457(use-package visual-fill-column
458 :init
459 (setq split-window-preferred-function 'visual-fill-column-split-window-sensibly)
460 (setq visual-fill-column-center-text t)
461 :config
462 (advice-add 'text-scale-adjust
463 :after #'visual-fill-column-adjust))
464
465;;;; Machine-specific
466;;;;; Linux at home
467(when *acdw/at-home*
468;;;;;; Edit files with `sudo' (I think?)
469 (use-package su
470 :config
471 (su-mode))
472;;;;;; Implement XDG Trash specification
473 (use-package trashed
474 :init
475 (setq delete-by-moving-to-trash t))
476;;;;;; Build exec-path from $PATH
477 (use-package exec-path-from-shell
478 :demand
479 :config
480 (exec-path-from-shell-initialize))
481 )
482;;; Specialized packages
483;;;; Gemini & Gopher
367(use-package elpher 484(use-package elpher
368 :straight (elpher 485 :straight (elpher
369 :repo "git://thelambdalab.xyz/elpher.git") 486 :repo "git://thelambdalab.xyz/elpher.git")
@@ -372,7 +489,10 @@
372 ("p" . elpher-prev-link) 489 ("p" . elpher-prev-link)
373 ("o" . elpher-follow-current-link) 490 ("o" . elpher-follow-current-link)
374 ("G" . elpher-go-current)) 491 ("G" . elpher-go-current))
375 :hook (elpher-mode-hook . variable-pitch-mode)) 492 :hook (elpher-mode-hook . (lambda ()
493 (variable-pitch-mode)
494 (set-fill-column 100)
495 (visual-fill-column-mode))))
376 496
377(use-package gemini-mode 497(use-package gemini-mode
378 :straight (gemini-mode 498 :straight (gemini-mode
@@ -418,7 +538,7 @@
418 (re-search-forward "\\(gemini://.*\\.gmi\\)") 538 (re-search-forward "\\(gemini://.*\\.gmi\\)")
419 (elpher-go (match-string 1))))) 539 (elpher-go (match-string 1)))))
420 540
421;;; exwm ~ Emacs X Window Manager 541;;;; exwm ~ Emacs X Window Manager
422(when *acdw/at-larry* 542(when *acdw/at-larry*
423 (use-package exwm 543 (use-package exwm
424 :if window-system 544 :if window-system
@@ -515,7 +635,7 @@
515 635
516 ) ;; end of *acdw/at-larry* block for exwm 636 ) ;; end of *acdw/at-larry* block for exwm
517 637
518;;; other applications 638;;;; IRC
519(use-package circe 639(use-package circe
520 :if *acdw/at-larry* 640 :if *acdw/at-larry*
521 :init 641 :init
@@ -582,8 +702,7 @@
582 (circe-originator-face ((t (:weight bold)))) 702 (circe-originator-face ((t (:weight bold))))
583 (circe-prompt-face ((t (:inherit 'circe-my-message-face))))) 703 (circe-prompt-face ((t (:inherit 'circe-my-message-face)))))
584 704
585;;; eshell 705;;;; eshell
586
587(use-package eshell 706(use-package eshell
588 :init 707 :init
589 (defun eshell/emacs (&rest args) 708 (defun eshell/emacs (&rest args)
@@ -607,9 +726,9 @@
607(use-package eshell-syntax-highlighting 726(use-package eshell-syntax-highlighting
608 :after esh-mode 727 :after esh-mode
609 :config 728 :config
610 (eshell-syntax-highlighting-global-mode 1)) 729 (eshell-syntax-highlighting-global-mode))
611 730
612;;; org-mode 731;;;; org-mode
613(use-package org 732(use-package org
614 :init 733 :init
615 (setq org-startup-indented t) 734 (setq org-startup-indented t)
@@ -625,27 +744,11 @@
625 (match-end 1) 744 (match-end 1)
626 "•")))))) 745 "•"))))))
627 :hook 746 :hook
628 (org-mode-hook . (lambda () 747 (org-mode-hook . variable-pitch-mode))
629 (variable-pitch-mode 1)
630 (visual-line-mode)
631 (visual-fill-column-mode))))
632 748
633(use-package org-bullets 749(use-package org-bullets
634 :hook 750 :hook
635 (org-mode-hook . (lambda () (org-bullets-mode 1)))) 751 (org-mode-hook . (lambda () (org-bullets-mode))))
636 752
637;; ;;; gnus 753(provide 'init)
638;; (use-package gnus 754;;; init.el ends here
639;; :straight (:type built-in)
640;; :config
641;; (setq gnus-select-method '(nnnil ""))
642;; (setq gnus-secondary-select-methods
643;; '((nnmaildir "fastmail" (directory "~/.mail/fastmail"))))
644;; (setq gnus-parameters
645;; '((".*" ; fallback
646;; (posting-style
647;; (gcc "nnmaildir+fastmail:Sent")
648;; (From
649;; (format "%s <%s>" user-full-name user-mail-address))))))
650;; (setq gnus-gcc-mark-as-read t)
651;; (setq gnus-agent t))