-
Notifications
You must be signed in to change notification settings - Fork 0
/
packages.el
501 lines (421 loc) · 12.2 KB
/
packages.el
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
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
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
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
489
490
491
492
493
494
495
496
497
498
499
500
501
(require 'package)
(require 'keys)
(setq package-archives
'(("gnu" . "https://elpa.gnu.org/packages/")
("melpa-stable" . "https://stable.melpa.org/packages/")
("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/"))
package-archive-priorities
'(("gnu" . 3)
("org" . 2)
("melpa-stable" . 1)
("melpa" . 0)))
(package-initialize)
;; bootstrap use-package
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
;; Get delight first so other packages can use it
(use-package delight
:ensure t)
;; Look at names in `minor-mode-alist' to see what exactly to delight
;;;
(use-package ace-window
:ensure t
:pin melpa
:config
(defkey C-o ace-window)
(ace-window-display-mode)
(setq aw-keys '(?a ?s ?d ?f ?z ?x ?c ?v ?b)) ;fix ?b
(setq aw-dispatch-always t)
(setq aw-dispatch-alist
'((?0 aw-delete-window "Delete Window")
(?m aw-swap-window "Swap Window")
(?j aw-switch-buffer-in-window "Select Buffer")
(?n aw-flip-window)
(?2 aw-split-window-vert "Split Vert Window")
(?3 aw-split-window-horz "Split Horz Window")
(?1 delete-other-windows "Maximize Window")
(?u aw-switch-buffer-other-window "Switch Buffer Other Window")
(?h aw-execute-command-other-window "Execute Command Other Window")
(?? aw-show-dispatch-help)))
(setq aw-make-frame-char ?6))
(use-package avy
:ensure t
:config
(defkeys
C-j avy-goto-char-timer
M-j avy-goto-line))
(use-package beacon
:ensure t
:delight beacon-mode
:config (beacon-mode))
(use-package cc-mode
:config
(c-set-offset 'case-label '+))
(use-package csv-mode
:ensure t
:config
(setq
csv-align-padding 3
csv-align-style 'right))
(use-package company
:ensure t
:delight company-mode
:config (global-company-mode))
(use-package compile
:config
(setq compilation-scroll-output t)
(defkeys-in-map compilation-mode-map
C-o ace-window))
(use-package conf-mode
:config (add-hook 'conf-mode-hook
(lambda () (setq tab-width 4))))
(use-package dired
:config
(require 'dired-x)
;; The default key for dired-up-directory is ^ -- wtf?
;; That might be literally the most inconvenient key.
;; Make it easy to go up from either side of the keyboard.
(define-key dired-mode-map ";" 'dired-up-directory)
(define-key dired-mode-map "3" 'dired-find-file)
(define-key dired-mode-map (kbd "C-o") nil)
(define-key dired-mode-map (kbd "C-t") nil)
(add-hook 'dired-mode-hook #'auto-revert-mode)
(add-hook 'dired-mode-hook #'dired-omit-mode)
(add-to-list
'dired-guess-shell-alist-default
'("\\.aup\\'" "audacity"))
(add-to-list
'dired-guess-shell-alist-default
'("\\.mp4\\'" "vlc"))
(add-to-list
'dired-guess-shell-alist-default
'("\\.mkv\\'" "vlc"))
(setq dired-omit-verbose nil)
(defkey (C-x C-d) dired-jump))
(use-package dumb-jump
:ensure t
:config
(dumb-jump-mode)
(defkey M-g dumb-jump-go-prompt))
(use-package elfeed
:ensure t
:config
(defmacro elfeed-set-feeds (&rest feeds)
`(setq elfeed-feeds ',(mapcar #'symbol-name feeds)))
(elfeed-set-feeds
;; MN Friends
https://begriffs.com/atom.xml
https://christianwood.net/feed.xml
https://cyberia.club/blog/blog.xml
https://davebucklin.com/feed.xml
http://faehnri.ch/feed.xml
https://www.ianbicking.org/feeds/atom.xml
https://kd9kjv.com/feed.xml
https://kyle.marek-spartz.org/atom.xml
https://mxuribe.com/atom-feed.xml
https://spencerkrum.com/posts/index.xml
https://sequentialread.com/rss/
https://nickdrozd.github.io/feed.xml
;; Other
https://genehack.blog/atom.xml
https://andreyorst.gitlab.io/feed.xml
https://www.gonsie.com/blorg/feed.xml
https://www.sligocki.com/feed.xml
;; Still other
https://www.scottaaronson.com/blog/?feed=rss2
))
(use-package engine-mode
:ensure t
:config
(engine-mode)
(engine/set-keymap-prefix (kbd "C-c ;"))
(setq engine/browser-function 'eww-browse-url)
(let ((engine-list (emacs-file "engine-list.el")))
(if (file-exists-p engine-list)
(load engine-list)
(message "Failed to load engine-list.el"))))
(use-package exec-path-from-shell
:if (or *is-mac* *is-linux*)
:ensure t
:config (exec-path-from-shell-initialize))
(use-package fireplace
:ensure t
:pin melpa)
(use-package generic-x)
(use-package god-mode
:ensure t
:config
(setq god-literal-key " "
god-mod-alist '((nil . "C-")
("m" . "M-")
("i" . "s-")
("w" . "H-")
("[" . "C-M-")))
(defkey C-\\ god-mode-all)
(defun god-mode-update-cursor ()
(setq cursor-type
(if (or god-local-mode
buffer-read-only)
'hollow
'box)))
(add-hook 'god-mode-enabled-hook 'god-mode-update-cursor)
(add-hook 'god-mode-disabled-hook 'god-mode-update-cursor))
(use-package go-mode
:ensure t
:config
(add-hook 'before-save-hook #'gofmt-before-save))
(use-package hackernews
:ensure t
:config
(setq
hackernews-comments-format "* %3s |"
hackernews-item-format "%c %t\n"
hackernews-items-per-page 50)
(set-face-attribute
'hackernews-comment-count nil
:foreground "lightblue")
(add-to-list 'same-window-regexps "\*hackernews.*\*")
;; See https://github.com/clarete/hackernews.el/pull/45
(define-advice hackernews (:around (fn &rest args) hackernews--dynamic-story-count)
"Adapt `hackernews-items-per-page' to current window height."
(let ((hackernews-items-per-page (1- (window-text-height))))
(apply fn args))))
(use-package helpful
:ensure t
:pin melpa
:config
(defkeys
(C-h f) helpful-callable
(C-h v) helpful-variable
(C-h k) helpful-key
(C-h C-h) helpful-at-point
(C-h C-q) helpful-kill-buffers))
(use-package hideshow
:delight hs-minor-mode)
(use-package hl-line
:config
(global-hl-line-mode)
(set-face-attribute
'hl-line nil
:background "midnight blue"
:foreground nil))
(use-package ido
:config (setq
ido-enable-flex-matching t
ido-use-filename-at-point 'guess
ido-use-url-at-point t))
(use-package idris-mode
:pin melpa
:ensure t
:config
(setq idris-interpreter-path "idris2")
(add-to-list 'completion-ignored-extensions ".ibc")
(add-to-list 'dired-omit-extensions ".ibc")
(defun idris-kill ()
(interactive)
(kill-process "idris")))
(use-package info
:config
(add-to-list 'Info-directory-list
(expand-file-name "~/info")))
(use-package magit
:ensure t
:config
(setq magit-log-arguments '("--graph" "--color" "--decorate" "-n256")
magit-rebase-arguments '("--autosquash" "--autostash"))
(defkeys
s-b magit-blame))
(use-package markdown-mode
:ensure t)
(use-package move-text
:ensure t
:config (move-text-default-bindings))
(use-package nameless
:ensure t
:config
(setq
nameless-private-prefix t
nameless-affect-indentation-and-filling nil)
(add-hook 'emacs-lisp-mode-hook #'nameless-mode))
(use-package org
:config
(require 'org-capture)
(require 'org-tempo)
(defkeys
(C-c n a) org-agenda
(C-c n c) org-capture
(C-c n l) org-store-link)
;; https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html
(setq
org-agenda-files
'("~/org/inbox.org"
"~/org/projects.org"
"~/org/reminders.org"))
;; Each entry is a list with the following items:
;; keys The keys that will select the template, as a string.
;; description A short string describing the template.
;; type Type of entry: entry, item, checkitem, table-line, plain.
;; target Specification of where the captured item should be placed.
;; template The template for creating the capture item.
(setq
org-capture-templates
'(("i" "Inbox" entry
(file+headline "~/org/inbox.org" "Tasks")
"* TODO %i%?")
("r" "Reminders" entry
(file+headline "~/org/reminders.org" "Reminders")
"* %i%? \n %U")))
(setq
org-refile-targets
'(("~/org/projects.org" :maxlevel . 1)
("~/org/someday.org" :level . 1)
("~/org/reminders.org" :maxlevel . 2)
("~/org/notes.org" :level . 1)))
(setq
org-todo-keywords
(let ((todos '("TODO(t)" "NEXT(n)" "WAITING(w)"))
(dones '("DONE(d)" "CANCELLED(c)")))
`((sequence ,@todos "|" ,@dones))))
(defkeys-in-map org-mode-map
C-k kill-ring-save
C-v org-yank
C-y backward-kill-word
M-y org-kill-line)
(setq
org-src-fontify-natively t
org-src-preserve-indentation t
org-src-tab-acts-natively t
org-src-window-setup 'current-window
org-confirm-babel-evaluate nil
org-list-allow-alphabetical t
)
(define-key org-mode-map (kbd "C-,") nil)
(define-key org-mode-map (kbd "C-j") nil)
;; I think the standard way of configuring babel languages is gross
(defun org-babel-load-languages (&optional enable-list disable-list)
"Enable the langs in ENABLE-LIST, disable those in DISABLE-LIST."
(let ((enable-pairs (mapcar (lambda (lang) (cons lang t)) enable-list))
(disable-pairs (mapcar (lambda (lang) (cons lang nil)) disable-list)))
(org-babel-do-load-languages
'org-babel-load-languages
(append enable-pairs disable-pairs))))
(org-babel-load-languages
'(C python js emacs-lisp shell scheme lisp makefile)))
(use-package org-present
:ensure t
:config
(setq
org-present-mode-hook
(lambda ()
(delete-other-windows)
(org-present-big)
(org-display-inline-images)
(org-present-hide-cursor)
(org-present-read-only))
org-present-mode-quit-hook
(lambda ()
(org-present-small)
(org-remove-inline-images)
(org-present-show-cursor)
(org-present-read-write))))
(use-package ox-jekyll-md
:ensure t)
(use-package paredit
:ensure t)
(use-package pdf-tools
:ensure t
:config
(setq pdf-view-midnight-colors '("white" . "black")))
(use-package php-mode
:ensure t)
(use-package prog-mode
:config
(add-hook 'prog-mode-hook
(lambda ()
(auto-fill-mode)
(setq comment-auto-fill-only-comments t)
(hs-minor-mode)
(setq indent-tabs-mode nil)
(setq tab-width 4))))
(use-package projectile
:ensure t
:delight projectile-mode '(:eval (format " [%s]" (projectile-project-name)))
:init
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
:config
(setq projectile-switch-project-action 'projectile-vc)
(projectile-mode))
(use-package python
:config
(setq
python-shell-interpreter "python3"
python-shell-interpreter-args " -i"))
(use-package racket-mode
:ensure t)
(use-package rainbow-delimiters
:ensure t
:config
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
;; from yoo2080.wordpress.com/2013/12/21/small-rainbow-delimiters-tutorial
(require 'cl-lib)
(require 'color)
(cl-loop
for index from 1 to rainbow-delimiters-max-face-count
do
(let ((face (intern (format "rainbow-delimiters-depth-%d-face" index))))
(cl-callf color-saturate-name (face-foreground face) 100))))
(use-package re-builder
:config (setq reb-re-syntax 'string))
(use-package refine
:ensure t)
(use-package rust-mode
:ensure t
:config
(setq rust-format-on-save t)
(use-package cargo
:ensure t
:config
(add-hook 'rust-mode-hook
'cargo-minor-mode)))
(use-package shell
:config
(setq comint-input-ignoredups t))
(use-package simple
:delight auto-fill-function)
(use-package smartparens
:ensure t
:delight smartparens-mode
:config
(require 'smartparens-config)
(smartparens-global-mode))
(use-package smex
:ensure t
:config
(smex-initialize)
(defkeys
M-x smex
H-x smex))
(use-package suggest
:ensure t
:pin melpa
:config
(setq suggest-insert-example-on-start nil))
(use-package tetris
:config
(advice-add
'tetris :around
(lambda (_)
(message "Stop playing Tetris, you asshole"))))
(use-package text-mode
:preface (provide 'text-mode)
:config (add-hook 'text-mode-hook 'auto-fill-mode))
(use-package which-key
:ensure t
:delight which-key-mode
:config
(which-key-mode)
(setq which-key-idle-delay 2.0))
(use-package yaml-mode
:ensure t)