-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexternal-packages.el
212 lines (185 loc) · 6.78 KB
/
external-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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; trying use-package with MELPA now instead of el-get. el-get was
;; having trouble matching up dependencies, maybe because I added
;; MELPA to it? Also, dang Glyph got me nervous about security and
;; el-get pulling from the wiki or who knows where.
;;
;; NOTE: will not automatically delete packages that I remove from
;; this file like el-get does. That'll have to be manual, sadly.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; use melpa, comes from here:
;; http://melpa.milkbox.net/#/getting-started
(require 'package)
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" "https://melpa.org/packages/") t)
;;(add-to-list 'package-archives (cons "melpa-stable" "https://stable.melpa.org/packages/") t)
(when (< emacs-major-version 27)
(package-initialize))
(eval-when-compile
(if (not (package-installed-p 'use-package))
(progn (package-refresh-contents)
(package-install 'use-package)))
(require 'use-package))
(use-package ag
:ensure t
:custom (ag-arguments (list "--word-regexp" "--smart-case"))
;; replace xref:
:config (define-key global-map [remap xref-find-references] 'ag-project))
(use-package cmake-mode
:ensure t)
;; replaces guess-offset
(use-package dtrt-indent
:ensure t
:init (dtrt-indent-global-mode 1))
(use-package dumb-jump
:ensure t
:custom (dumb-jump-force-searcher 'ag)
;; replace xref:
:config
(add-hook 'xref-backend-functions #'dumb-jump-xref-activate))
(use-package color-theme-modern
:ensure t)
(use-package tango-2-theme
:ensure t
:config (load-theme 'tango-2 t))
;; more ido-like completion:
(use-package crm-custom
:ensure t
:config (crm-custom-mode 1))
(use-package exec-path-from-shell
:ensure t
:config (exec-path-from-shell-initialize))
(use-package graphviz-dot-mode
:ensure t)
(use-package ido-completing-read+
:ensure t
:config (ido-ubiquitous-mode 1))
(use-package magit
:ensure t
:custom (magit-completing-read-function 'magit-ido-completing-read))
(use-package magit-log
:init
(progn
;; Default value:
;; (setq magit-log-margin '(t age magit-log-margin-width t 18))
(setq magit-log-margin
'(t age-abbreviated magit-log-margin-width :author 11))))
(use-package markdown-mode
:ensure t)
;; magit and smart-tab are currently incompatible :-(
;; (use-package smart-tab
;; :ensure t
;; :config (global-smart-tab-mode 1))
(use-package smex
:ensure t
;; Invoke M-x without the Alt key. I got this from
;; http://www.cabochon.com/~stevey/blog-rants/effective-emacs.html
:bind (("C-x C-m" . smex)
("M-x" . smex)
("M-X" . smex-major-mode-commands)))
(use-package wgrep-ag
:ensure t)
(use-package yaml-mode
:ensure t
:init
(add-hook 'yaml-mode-hook (lambda () (flyspell-mode 0))))
;; more essentials for big hairy yaml file editing,
;; highlight-indent-guides and indent-tools
(use-package highlight-indent-guides
:ensure t
:config
(add-hook 'prog-mode-hook 'highlight-indent-guides-mode)
(add-hook 'yaml-mode-hook 'highlight-indent-guides-mode)
(add-hook 'org-mode-hook 'highlight-indent-guides-mode))
;; I've avoided hydra for a while now, but indent-tools really wanted
;; it, and after using magit for a while, it looks pretty normal to me
;; now. Oh, and it can replace smartrep! OK, I'm sold.
(use-package hydra
:ensure t
:config
(defhydra hydra-window-size (global-map "C-x")
"shrink and grow windows"
("{" shrink-window-horizontally)
("}" enlarge-window-horizontally))
(defhydra hydra-other-window (global-map "C-x")
"move to other window(s)"
("o" other-window))
;; from the hydra wiki:
;; https://github.com/abo-abo/hydra/wiki/Rectangle-Operations
(defhydra hydra-rectangle (:body-pre (rectangle-mark-mode 1)
:color pink
:hint nil
:post (deactivate-mark))
"
^_k_^ _w_ copy _o_pen _N_umber-lines |\\ -,,,--,,_
_h_ _l_ _y_ank _t_ype _e_xchange-point /,`.-'`' .. \-;;,_
^_j_^ _d_ kill _c_lear _r_eset-region-mark |,4- ) )_ .;.( `'-'
^^^^ _u_ndo _q_ quit ^ ^ '---''(./..)-'(_\_)
"
("k" rectangle-previous-line)
("j" rectangle-next-line)
("h" rectangle-backward-char)
("l" rectangle-forward-char)
("d" kill-rectangle) ;; C-x r k
("y" yank-rectangle) ;; C-x r y
("w" copy-rectangle-as-kill) ;; C-x r M-w
("o" open-rectangle) ;; C-x r o
("t" string-rectangle) ;; C-x r t
("c" clear-rectangle) ;; C-x r c
("e" rectangle-exchange-point-and-mark) ;; C-x C-x
("N" rectangle-number-lines) ;; C-x r N
("r" (if (region-active-p)
(deactivate-mark)
(rectangle-mark-mode 1)))
("u" undo nil)
("q" nil))
(global-set-key (kbd "C-c R") 'hydra-rectangle/body))
(use-package indent-tools
:ensure t
:config
;; this conflicts with org-goto-calendar, but none of this is very
;; helpful in org-mode anyway
(global-set-key (kbd "C-c i") 'indent-tools-hydra/body)
(add-hook 'yaml-mode-hook
(lambda ()
(define-key yaml-mode-map (kbd "C-c i")
'indent-tools-hydra/body))))
;; needed for polymode below
(use-package jinja2-mode
:ensure t)
(use-package polymode
:ensure t
;; pretty neat, a mode for jinja2 inside verilog. I followed the
;; example here:
;; https://www.masteringemacs.org/article/polymode-multiple-major-modes-how-to-use-sql-python-in-one-buffer
:mode ("\\.jinja\\'" . poly-verilog-jinja2-mode)
:config
(define-hostmode poly-verilog-hostmode :mode 'verilog-mode)
;; this function came: from https://gitlab.com/mavit/poly-ansible
(defcustom pm-inner/jinja2
(pm-inner-chunkmode :mode #'jinja2-mode
:head-matcher "{[%{#][+-]?"
:tail-matcher "[+-]?[%}#]}"
:head-mode 'body
:head-adjust-face nil)
"Jinja2 chunk."
:group 'innermodes
:type 'object)
(define-polymode poly-verilog-jinja2-mode
:hostmode 'poly-verilog-hostmode
:innermodes '(pm-inner/jinja2)
(verilog 1)))
(use-package expand-region
:ensure t
;; the cool thing about this is you can hit C-c h and then keep
;; hitting just h to continue expanding the region
:config (global-set-key (kbd "C-c h") 'er/expand-region))
(use-package py-isort
:ensure t
:config (add-hook 'before-save-hook 'py-isort-before-save))
(use-package direnv
:config
(direnv-mode)
(setq direnv-always-show-summary nil))