-
Notifications
You must be signed in to change notification settings - Fork 0
/
packages.el
523 lines (436 loc) · 14.3 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
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
;;; my-packages.el --- Summary
;;; Commentary:
;; Bootstraps all the packages I use, configuring most of them to be
;; lazily loaded.
;;; Code:
(use-package ag
:bind (:map mode-specific-map
("s a" . ag-regexp))
:ensure-system-package ag)
(use-package aggressive-indent
:defer t
:delight
:init
(add-hook 'emacs-lisp-mode-hook #'aggressive-indent-mode))
(use-package auto-package-update
:disabled
:init
(setq auto-package-update-last-update-day-filename (concat var-directory "last-package-update-day"))
:config
(setq auto-package-update-delete-old-versions t)
(setq auto-package-update-hide-results t)
(auto-package-update-maybe))
(use-package autorevert
:delight auto-revert-mode)
(use-package bookmark
:config
(setq bookmark-default-file (concat var-directory "emacs.bmk")))
(use-package browse-kill-ring
:bind ("M-y" . browse-kill-ring))
(use-package cmake-mode)
(use-package coffee-mode)
(use-package company
:config
(global-company-mode)
:delight)
(use-package dtrt-indent
:custom
(dtrt-indent-global-mode t)
:delight)
(use-package dictionary
:init
(bind-keys :prefix-map my-dictionary-prefix-map
:prefix "C-c C-d"
("l" . dictionary-lookup-definition)
("m" . dictionary-match-words)
("s" . dictionary-search))
:config
(add-to-list 'display-buffer-alist
'("^\\*Dictionary\\*" display-buffer-in-side-window
(side . bottom)))
(setq dictionary-server "localhost"))
(use-package diff
:config
(setq diff-switches "-u"))
(use-package docker
:ensure t
:bind ("C-c d" . docker))
(use-package dockerfile-mode
:config
(put 'dockerfile-image-name 'safe-local-varible #'stringp))
(use-package dumb-jump
:requires ivy
:init
(bind-keys :prefix-map my-dumb-jump-prefix-map
:prefix "M-g"
("o" . dumb-jump-go-other-window)
("j" . dumb-jump-go)
("i" . dumb-jump-go-prompt)
("x" . dumb-jump-go-prefer-external)
("z" . dumb-jump-go-prefer-external-other-window))
:config
(setq dumb-jump-selector 'ivy)
:ensure-system-package ag)
(use-package ediff
:config
(setq ediff-window-setup-function 'ediff-setup-windows-plain))
(use-package edit-server
:ensure t
:commands edit-server-start
:init (if after-init-time
(edit-server-start)
(add-hook 'after-init-hook
#'(lambda() (edit-server-start))))
:config (setq edit-server-new-frame-alist
'((name . "Edit with Emacs FRAME")
(top . 200)
(left . 200)
(width . 80)
(height . 25)
(minibuffer . t)
(menu-bar-lines . t)
(window-system . x))))
(use-package enh-ruby-mode
:interpreter "ruby")
(use-package exec-path-from-shell
:demand t
:if (memq window-system '(mac ns))
:config
(setq exec-path-from-shell-check-startup-files nil)
(exec-path-from-shell-initialize))
(use-package feature-mode :defer t)
(use-package ffap
:config
(setq ffap-require-prefix t))
(use-package flycheck
:init
(add-hook 'flycheck-mode-hook #'toggle-truncate-lines)
(add-hook 'prog-mode-hook #'flycheck-mode))
(use-package flycheck-pos-tip
:after flycheck
:config
(flycheck-pos-tip-mode))
(use-package flyspell
:init
(add-hook 'text-mode-hook #'flyspell-mode)
(add-hook 'prog-mode-hook #'flyspell-prog-mode)
:delight)
(use-package flx-ido
:after ido
:config
(flx-ido-mode 1))
(use-package forge
:if (memq window-system '(mac ns x))
:after magit
:init
(setq forge-database-file (concat var-directory "forge-database.sqlite")))
(use-package git-modes)
(use-package graphql-mode)
(use-package groovy-mode)
(use-package harvest
:disabled
:requires (org hydra ivy)
:init
(add-hook 'org-clock-in-hook #'harvest)
(add-hook 'org-clock-out-hook #'harvest-clock-out))
(use-package hcl-mode)
(use-package hydra
:disabled)
(use-package ido
:bind ("C-x M-f" . ido-find-file-other-window)
:config
(define-key (current-global-map) [remap find-file-other-window]
'ido-find-file-other-window)
(if (>= emacs-major-version 29)
(keymap-set ido-file-completion-map "C-k" #'ido-delete-file-at-head))
(ido-mode t)
(ido-everywhere 1)
(setq ido-auto-merge-work-directories-length nil
ido-confirm-unique-completion t
ido-create-new-buffer 'always
ido-default-buffer-method 'selected-window
ido-enable-flex-matching t
ido-enable-prefix nil
ido-max-prospects 10
ido-save-directory-list-file (concat var-directory "ido.last")
ido-use-faces nil
ido-use-filename-at-point 'guess
ido-use-virtual-buffers t))
(use-package ido-completing-read+
:after ido
:config
(ido-ubiquitous-mode))
(use-package inf-ruby
:disabled) ; bindings are inflexible, load/unload as needed
(use-package ispell
:ensure-system-package aspell
:init
(defun endless/ispell-word-then-abbrev (p)
"Call `ispell-word', then create an abbrev for it.
With prefix P, create local abbrev. Otherwise it will
be global.
If there's nothing wrong with the word at point, keep
looking for a typo until the beginning of buffer. You can
skip typos you don't want to fix with `SPC', and you can
abort completely with `C-g'."
(interactive "P")
(let (bef aft)
(save-excursion
(while (if (setq bef (thing-at-point 'word))
;; Word was corrected or used quit.
(if (ispell-word nil 'quiet)
nil ; End the loop.
;; Also end if we reach `bob'.
(not (bobp)))
;; If there's no word at point, keep looking
;; until `bob'.
(not (bobp)))
(backward-word))
(setq aft (thing-at-point 'word)))
(if (and aft bef (not (equal aft bef)))
(let ((aft (downcase aft))
(bef (downcase bef)))
(define-abbrev
(if p local-abbrev-table global-abbrev-table)
bef aft)
(message "\"%s\" now expands to \"%s\" %sally"
bef aft (if p "loc" "glob")))
(user-error "No typo at or before point"))))
:bind (("M-x" . endless/ispell-word-then-abbrev)
("M-^" . ispell-comments-and-strings))
:config
(setq ispell-personal-dictionary (concat var-directory "ispell_english")))
(use-package ivy) ; TODO: evaluate in full later
(use-package json-mode)
(use-package json-reformat)
(use-package json-snatcher)
(use-package js2-mode
:ensure-system-package node
:interpreter "node")
(use-package kaesar)
(use-package kotlin-mode)
(use-package kubernetes
:ensure t
:ensure-system-package kubectl
:commands (kubernetes-overview))
(use-package lsp-mode
:defer t
:init
(setq lsp-session-file (concat var-directory "lsp-session-v1"))
:config
(add-hook 'ruby-ts-mode-hook #'lsp))
(use-package markdown-mode
:mode "\\.mdwn\\'" "\\.mdtxt\\'" "\\.mkd\\'" "\\.mkdn\\'"
:ensure-system-package markdown
:config
(setq markdown-open-command (executable-find "markdown")))
(use-package magit
:after libgit)
(use-package midnight
:config
(add-to-list 'clean-buffer-list-kill-never-buffer-names "*msg*")
(append clean-buffer-list-kill-buffer-names '("*Shell Command Output*"
"*Completions*"
"*Occur*"
"*Bookmark List*"
"*Ediff Registry*"
"*ag search"
"*markdown-output*"))
(midnight-delay-set 'midnight-delay 4400))
(use-package multi-term
:bind (:map mode-specific-map
("t" . get-term)
("T" . multi-term-dedicated-toggle))
:config
(defun last-term-buffer (l)
"Return most recently used term buffer."
(when l
(if (eq 'term-mode (with-current-buffer (car l) major-mode))
(car l) (last-term-buffer (cdr l)))))
(defun get-term ()
"Switch to the term buffer last used, or create a new one if
none exists, or if the current buffer is already a term."
(interactive)
(let ((b (last-term-buffer (buffer-list))))
(if (or (not b) (eq 'term-mode major-mode))
(multi-term)
(switch-to-buffer b))))
:custom
term-bind-key-alist '(("C-a" . term-bol)
("C-c" . term-interrupt-subjob)
("C-p" . term-send-up)
("C-n" . term-send-down)
("C-s" . isearch-forward)
("C-r" . term-send-reverse-search-history)
("C-m" . term-send-raw)
("C-k" . term-send-kill-whole-line)
("C-y" . term-paste)
("C-_" . term-send-raw)
("M-f" . term-send-forward-word)
("M-b" . term-send-backward-word)
("M-K" . term-send-kill-line)
("M-p" . previous-line)
("M-n" . next-line)
("M-y" . yank-pop)
("M-." . term-send-raw-meta))
term-unbind-key-list '("C-z" "C-x" "C-c" "C-h" "C-y" "M-y" "<ESC>"))
(use-package org
:init
:config
(setq org-directory "~/var/org/"
org-agenda-files (file-expand-wildcards (concat org-directory "**/*.org"))))
(use-package ox-jira)
(use-package paredit
:defer t
:delight
:init
(add-hook 'emacs-lisp-mode-hook #'paredit-mode))
(use-package powershell
:if (memq window-system '(pc w32)))
(use-package proced
:config
(setq proced-enable-color-flag t))
(use-package projectile
:requires ivy
:delight '(:eval (concat " " (projectile-project-name)))
:init
(setq projectile-known-projects-file (concat var-directory "projectile-bookmarks.eld"))
:config
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
(projectile-mode +1)
(setq projectile-cache-file (concat var-directory "projectile.cache")
projectile-completion-system 'ivy
projectile-enable-caching t))
(use-package recentf
:config
(setq recentf-save-file (concat var-directory "recentf")))
(use-package rbenv
:init
(add-hook 'ruby-ts-mode-hook #'rbenv-use-corresponding)
:config
(global-rbenv-mode))
(use-package ripgrep
:bind (:map mode-specific-map
("s r" . ripgrep-regexp))
:ensure-system-package rg)
(use-package rspec-mode
:after yasnippet
:delight
:hook ruby-ts-mode
:config
(defadvice rspec-compile (around rspec-compile-around)
"Use BASH shell for running the specs because of ZSH issues."
(let ((shell-file-name "/bin/bash"))
ad-do-it))
(ad-activate 'rspec-compile)
(rspec-install-snippets))
(use-package rubocop
:delight
:init
(add-hook 'ruby-ts-mode-hook #'rubocop-mode))
(use-package rustic
:requires lsp-mode)
(use-package saveplace
:config
(setq save-place-file (concat var-directory "places")))
(use-package solarized-theme
:disabled
:init
(setq solarized-distinct-fringe-background t
solarized-high-contrast-mode-line t)
:config
(load-theme 'solarized-dark t))
(use-package smex
:bind (("C-x C-m" . smex)
:map mode-specific-map
("C-m" . smex-major-mode-commands))
:config
(setq smex-save-file (concat var-directory "smex-items")))
(use-package ssh-agency
:if (memq window-system '(pc w32))
:config
(setenv "SSH_ASKPASS" "git-gui--askpass")
:after magit)
(use-package switch-window
:defer t
:init
(define-key (current-global-map) [remap other-window] 'switch-window)
:config
(setq-default switch-window-shortcut-style 'qwerty)
(setq-default switch-window-timeout nil))
(use-package tramp
:config
(setq tramp-persistency-file-name (concat var-directory "tramp")))
(use-package transient
:requires magit
:config
(setq transient-history-file (concat var-directory "transient/history.el")
transient-values-file (concat var-directory "transient/values.el")
transient-levels-file (concat var-directory "transient/levels.el")))
(use-package web-mode
:config
(setq web-mode-engines-alist '(("erb" . "\\.erb\\'")))
:mode "\\html?\\'" "\\.erb\\'")
(use-package wgrep-ag
:hook (ag-mode-hook . wgrep-ag-setup))
(use-package whitespace
:delight
:config
(setq whitespace-style '(face
tabs
spaces
trailing
lines
space-before-tab
newline
indentation
empty
space-after-tab
tab-mark)))
(use-package with-editor
:init
(define-key (current-global-map) [remap async-shell-command]
'with-editor-async-shell-command)
(define-key (current-global-map) [remap shell-command]
'with-editor-shell-command))
(use-package vterm
:init
(setq vterm-module-cmake-args "-DUSE_SYSTEM_LIBVTERM=no")
:custom-face
(term-color-blue ((t (:background "DeepSkyBlue3" :foreground "DeepSkyBlue3"))))
:ensure t
:ensure-system-package (libtool-bin libvterm-dev))
(use-package yagist
:requires kaesar
:init
(add-hook 'prog-mode-hook #'yagist-global-minor-mode)
(bind-keys :prefix-map my-yagist-prefix-map
:prefix "C-c C-g"
("B" . yagist-buffer-private)
("G" . yagist-region-or-buffer-private)
("R" . yagist-region-private)
("b" . yagist-buffer)
("g" . yagist-region-or-buffer)
("l" . yagist-list)
("r" . yagist-region))
(setq yagist-encrypt-risky-config t
yagist-view-gist t
yagist-working-directory "~/src/gists"))
(use-package yaml-mode :defer t)
(use-package yasnippet
:delight yas-minor-mode
:init
(add-hook 'prog-mode-hook #'yas-minor-mode)
:config
(add-to-list 'hippie-expand-try-functions-list 'yas-hippie-try-expand)
(yas-reload-all))
(use-package yard-mode
:delight
:hook ruby-ts-mode)
(use-package x509-mode)
(use-package xkcd
:config
(setq xkcd-cache-dir (concat var-directory "xkcd/")
xkcd-cache-latest (concat xkcd-cache-dir "latest")))
(provide 'my-packages)
;;; packages.el ends here