Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
;;; package --- Summary
;;;
;;; Emacs config file
;;;
;; Commentary:
;;;
;;; These first few override some of Emacs's most frustrating defaults.
;;; We put it early in the file because if anything in .emacs is
;;; broken, we at least want to turn off the goddam beeping. Having my
;;; laptop beep at me when I'm hitting the wrong keys because .emacs
;;; isn't loading my custom keys is extremely frustrating.
;;; Code:
(message "STARTING .EMACS")
;; Set this here, but unset it at the end of init
(setq debug-on-error t)
;; OMG, who wants beeps in this day and age?
(setq ring-bell-function 'ignore)
;; Don't ask about following symlinks into git dirs
(setq vc-follow-symlinks nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Save Desktop
;;
;; We don't actually want to save most things. If emacs is doing
;; restoration of themes, it interferes with us setting themes
;; because emacs doesn't respect our theme-per-frame as well as we
;; do.
;;
;; We do this high up in the .emacs because it is convenient to have
;; this already set in case we need to abort starting emacs, fix
;; .emacs, and try again.
(setq desktop-restore-frames nil)
(setq frameset-filter-alist
`((tabs . :never)
(background-color . :never)
(buffer-list . :never)
(buffer-predicate . :never)
(buried-buffer-list . :never)
(client . :never)
(delete-before . :never)
(font . :never)
(font-backend . :never)
(foreground-color . :never)
(frameset--text-pixel-height . :never)
(frameset--text-pixel-width . :never)
(fullscreen . :never)
(GUI:font . :never)
(GUI:fullscreen . :never)
(GUI:height . :never)
(GUI:width . :never)
(height . :never)
(outer-window-id . :never)
(parent-frame . :never)
(parent-id . :never)
(mouse-wheel-frame . :never)
(tty . frameset-filter-tty-to-GUI)
(tty-type . frameset-filter-tty-to-GUI)
(width . :never)
(window-id . :never)
(window-system . :never)
(name . :never)
(left . :never)
(minibuffer . :never)
(top . :never)
))
(desktop-save-mode 1)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages
'(ivy icicles auto-package-update dyalog-mode org-babel-eval-in-repl apl jedi ruff-format elpy evil-collecion xclip zoom-window yasnippet-snippets yaml-mode windata vterm typescript-mode tree-mode toml-mode tidal sly sass-mode rustic python-mode pkg-info pass origami org-roam neotree magit lua-mode lsp-ui load-theme-buffer-local kivy-mode gotest go-gen-test go-dlv fountain-mode evil-escape evil-commentary evil-collection elfeed edit-server dart-mode color-theme-modern coffee-mode auctex ansible-doc all-the-icons adoc-mode)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
;; Keep track of recent files
(recentf-mode 1)
(setq recentf-max-menu-items 25)
(setq recentf-max-saved-items 25)
(global-set-key "\C-x\ \C-r" 'recentf-open-files)
;; Completion
(setq completion-cycle-threshold 5
fido-mode 0)
(use-package ivy
:ensure t
:config (progn
(setq ivy-use-virtual-buffers t
ivy-count-format "(%d/%d) "
ivy-mode 1)
))
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Looks
;;
;; Dark theme
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
(load-theme 'dracula t)
;; Remove visual clutter
;; disable the menu bar, scrollbar, toolbar
(menu-bar-mode -1)
(scroll-bar-mode -1)
(tool-bar-mode -1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Packages
;;
;; Set up package handling
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(require 'use-package)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Evil Mode
;;
;; evil-collection admonished me to set this before loading evil
(setq evil-want-keybinding nil)
;; load evil
(use-package evil
:ensure t ;; install the evil package if not installed
:init ;; tweak evil's configuration before loading it
(setq evil-search-module 'evil-search)
(setq evil-ex-complete-emacs-commands nil)
(setq evil-vsplit-window-right t)
(setq evil-split-window-below t)
(setq evil-shift-round nil)
(setq evil-want-C-u-scroll t)
:config ;; tweak evil after loading it
(evil-mode)
(evil-commentary-mode)
)
;; Bring evil keybindings to more modes
(use-package evil-collection :ensure t :init)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Languge Server Protocol
;;
(use-package lsp-mode :ensure t :init)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; APL
;;
;; I grabbed apl.el from https://www.metalevel.at/unicapl/ and it
;; doesn't appear to be in any elisp package archives.
;;
;; To use this, do M-x set-input-method (C-u C-\) then specify
;; apl-ascii. Toggle back and forth between regular and apl-ascii
;; with C-\. When apl-asii is active (you'll see "apl" in the
;; modeline while in evil insert mode), put an ascii string in curly
;; braces and apl.el will replace it with the appropriate apl symbol
;; when you hit the closing brace. The replacement is triggered by
;; typing the closing brace and if your editing doesn't trigger
;; (e.g. because you didn't type it straight through, do M-x
;; apl-ascii-to-unicode to convert any ones in the buffer.
;;
;; A table of apl symbols and their ascii triggers is at
;; https://www.metalevel.at/unicapl/asciiapl.pdf and I put a copy in
;; ~/.emacs.d/3p/apl too.
;;
;; That table is also reproduced here:
;; " ¨
;; #% ⌹
;; #O ⌼
;; % ÷
;; & ⋄
;; - −
;; -> →
;; -| ⊣
;; /= ≠
;; /=_ ≢
;; /\ ∆
;; /\| ⍋
;; /match ≢
;; <- ←
;; <= ≤
;; =_ ≡
;; >= ≥
;; @ ⍝
;; I ⌶
;; I-beam ⌶
;; O ○
;; O" ⍥
;; O* ⍟
;; O- ⊖
;; O\ ⍉
;; T ⊤
;; \/~ ⍫
;; abs ∣
;; alpha ⍺
;; and ∧
;; assign ←
;; backslash-bar ⍀
;; base ⊥
;; box ⎕
;; branch →
;; caret ∧
;; catenate ,
;; ceiling ⌈
;; circle ○
;; circle-backslash ⍉
;; circle-dash ⊖
;; circle-diaeresis ⍥
;; circle-star ⍟
;; circle-stile ⌽
;; comment ⍝
;; compress /
;; compress1 ⌿
;; deal ?
;; decode ⊥
;; del ∇
;; del-stile ⍒
;; del-tilde ⍫
;; delta ∆
;; delta-stile ⍋
;; depth ≡
;; dex ⊣
;; diaeresis ¨
;; diamond ⋄
;; disclose ⊃
;; divide ÷
;; domino ⌹
;; down-arrow ↓
;; down-caret ∨
;; down-shoe ∪
;; down-tack ⊤
;; downcaret-tilde ⍱
;; downtack-jot ⍕
;; drop ↓
;; each ¨
;; enclose ⊂
;; encode ⊤
;; enlist ∈
;; epsilon ∈
;; epsilon-underbar ⍷
;; epsilon_ ⍷
;; execute ⍎
;; exp ⋆
;; expand \
;; expand1 ⍀
;; find ⍷
;; first ↑
;; floor ⌊
;; format ⍕
;; gets ←
;; goto →
;; grade-down ⍒
;; grade-up ⍋
;; greater-of ⌈
;; greater-than-equal ≥
;; holler ⍥
;; hoot ⍤
;; index ⌷
;; index-of ⍳
;; intersect ∩
;; intersection ∩
;; inverted-caret ∨
;; iota ⍳
;; iota-underbar ⍸
;; iota_ ⍸
;; is ←
;; jot ∘
;; jot-diaeresis ⍤
;; laminate ,
;; lamp ⍝
;; left-arrow ←
;; left-shoe ⊂
;; left-tack ⊣
;; leftbrace {
;; less-than-equal ≤
;; lesser-of ⌊
;; lev ⊢
;; ln ⍟
;; log ⍟
;; mat-divide ⌹
;; mat-inverse ⌹
;; match ≡
;; max ⌈
;; member ∈
;; member-of ∈
;; min ⌊
;; minus −
;; nabla ∇
;; nand ⍲
;; nazg ∘
;; negative −
;; nor ⍱
;; not ∼
;; not-equal ≠
;; not-match ≢
;; o ○
;; o" ⍥
;; omega ⍵
;; or ∨
;; partition ⊂
;; pi-times ○
;; pick ⊃
;; pow ⋆
;; quad ⎕
;; quad-backslash ⍂
;; quad-circle ⌼
;; quad-divide ⌹
;; quote-quad ⍞
;; rank ⍤
;; ravel ,
;; reciprocal ÷
;; reduce /
;; reduce1 ⌿
;; replicate /
;; replicate1 ⌿
;; represent ⊤
;; reshape ⍴
;; residue ∣
;; reverse ⌽
;; rho ⍴
;; right-arrow →
;; right-shoe ⊃
;; right-tack ⊢
;; rightbrace }
;; ring ∘
;; roll ?
;; rotate ⊖
;; rotate ⊖
;; scan \
;; scan1 ⍀
;; shape ⍴
;; signum ×
;; slash-bar ⌿
;; slope-bar ⍀
;; star ⋆
;; stile ∣
;; take ↑
;; tilde ∼
;; times ×
;; transpose ⍉
;; type ∈
;; union ∪
;; up-arrow ↑
;; up-caret ∧
;; up-shoe ∩
;; up-tack ⊥
;; upcaret-tilde ⍲
;; upshoe-jot ⍝
;; uptack-jot ⍎
;; w ⍵
;; x ×
;; |- ⊢
;; ~ ∼
;; ~^ ⍲
;; ~v ⍱
;(add-to-list 'load-path "~/.emacs.d/3p/apl")
;(require 'apl)
;; This gives us synax highlighting (and other things,
;; I'm not using those)
;(add-to-list 'load-path "~/.emacs.d/3p/gnu-apl")
;(require 'gnu-apl-mode)
;(add-to-list 'auto-mode-alist '("\\.apl\\'" . gnu-apl-mode))
(use-package dyalog-mode
:ensure t
:config
(add-to-list 'auto-mode-alist '("\\.apl\\'" . dyalog-mode))
(add-to-list 'auto-mode-alist '("\\.dyalog$" . dyalog-mode))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; YAS Snippet
; I think org babel python wants this because I get an error related
; to symbol function definition is void
; yasnippet-snippet--fixed-indent
(use-package yasnippet :ensure t)
(use-package yasnippet-snippets :ensure t)
(yas-reload-all)
(add-hook 'prog-mode-hook #'yas-minor-mode)
; Nope... that didn't fix it.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Org Mode
(use-package org
:ensure t)
(setq org-src-fontify-natively t)
(setq org-confirm-babel-evaluate nil)
(org-babel-do-load-languages
'org-babel-load-languages
'((python . t)
(shell . t)
(lisp . t)
))
(setq org-confirm-babel-evaluate nil)
(use-package org-roam
:ensure t
:custom
(org-roam-directory (file-truename "~/Documents/org-roam/"))
:bind (("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
("C-c n g" . org-roam-graph)
("C-c n i" . org-roam-node-insert)
("C-c n c" . org-roam-capture)
;; Dailies
("C-c n j" . org-roam-dailies-capture-today))
:config
;; If you're using a vertical completion framework, you might want a more informative completion interface
(setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
(org-roam-db-autosync-mode)
;; If using org-roam-protocol
(require 'org-roam-protocol)
(require 'org-roam-export) )
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Python
;;
(use-package jedi ; elpy wants this
:ensure t
:config
; We only need to do this once, not every time we start emacs
;(jedi:install-server)
)
(use-package elpy
;; C-c C-p to launch REPL
;; C-c C-c to run the file in the REPL
:ensure t
:config
; enable elpy-goto-definition
(add-hook 'python-mode-hook 'jedi-mode)
(elpy-enable)
)
;; Connect to the python language server, enable completion.
(add-hook 'python-mode-hook #'lsp) ;; pip3 install python-lsp-server
(add-hook 'python-mode-hook #'yas-minor-mode) ;; completion needs this
(setq lsp-pylsp-plugins-rope-autoimport-enabled t)
;; enable ruff formatting linter
(use-package ruff-format
:ensure t
:config
;(add-hook 'python-mode-hook 'ruff-format-on-save-mode)
)
;; We use ipython as our shell interpreter, mostly because it's good
;; for org-mode.
(setq python-shell-interpreter "ipython"
python-shell-interpreter-args "-i --simple-prompt")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; YAML mode
;;
(add-to-list 'load-path "~/.emacs.d/3p/yaml-mode")
(require 'yaml-mode)
(add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode))
(add-hook 'yaml-mode-hook
(lambda ()
(define-key yaml-mode-map "\C-m" 'newline-and-indent)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Update packages
(use-package auto-package-update
:ensure t
:config
(progn
(setq auto-package-update-delete-old-versions t
auto-package-update-interval 7)
(auto-package-update-maybe)
t)
)
(server-start)
;; We set this for init, but don't want it during normal operations
(setq debug-on-error nil)