-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.el_old3
More file actions
321 lines (271 loc) · 9.51 KB
/
Copy pathinit.el_old3
File metadata and controls
321 lines (271 loc) · 9.51 KB
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
(setq user-full-name "Aspasia Beneti"
user-mail-address "[email protected]")
(require 'package)
(setq package-enable-at-startup nil)
(when (>= emacs-major-version 24)
(setq package-archives '(("ELPA" . "http://tromey.com/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa-stable" . "http://stable.melpa.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("org" . "https://orgmode.org/elpa/")
("elpy" . "http://jorgenschaefer.github.io/packages/"))))
;; Refresh repos
(unless package-archive-contents
(package-refresh-contents))
(setq package-load-list '(all)) ;; List of packages to load
(package-initialize)
(unless (package-installed-p 'org) ;; Make sure the Org package is
(package-install 'org)) ;; installed, install it if not
;; make sure we can use packages
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(package-initialize)
;; only use use-package.el at compile-time
(eval-when-compile
(require 'use-package))
;; FIX: Install diminish and bind-key via use-package BEFORE requiring them.
;; Previously these were bare (require ...) calls which fail if the packages
;; aren't already on disk.
(use-package diminish
:ensure t)
(use-package bind-key
:ensure t)
(require 'diminish) ;; if you use :diminish
(require 'bind-key) ;; if you use any :bind variant
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Color themes
(add-to-list 'custom-theme-load-path "~/.emacs.d/color-themes")
(load-theme 'noctilux t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Functions
(defun my/setup-cider ()
(lambda ()
(setq cider-history-file "~/.nrepl-history"
cider-hide-special-buffers t
cider-repl-history-size 10000
cider-prefer-local-resources t
cider-popup-stacktraces-in-repl t)
(paredit-mode 1)
(eldoc-mode 1)))
(defun save-as (new-filename)
(interactive "FFilename:")
(write-region (point-min) (point-max) new-filename)
(find-file-noselect new-filename))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Generic config
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq make-backup-files nil)
;; Spaces only (no tab characters at all)!
(setq-default indent-tabs-mode nil)
;; Always show column numbers.
(setq-default column-number-mode t)
;; global-linum-mode was removed in Emacs 29; use display-line-numbers-mode instead
(if (fboundp 'global-display-line-numbers-mode)
(global-display-line-numbers-mode 1)
(global-linum-mode 1))
;; highlight matching parens
(show-paren-mode 1)
;; Display full pathname for files.
(add-hook 'find-file-hooks
'(lambda ()
(setq mode-line-buffer-identification 'buffer-file-truename)))
;; For easy window scrolling up and down.
(global-set-key "\M-n" 'scroll-up-line)
(global-set-key "\M-p" 'scroll-down-line)
(global-set-key "\M-A" 'indent-for-tab-command)
;; To find lein
(add-to-list 'exec-path "/usr/local/bin")
;; buffer list to appear on active window
(global-set-key "\C-x\C-b" 'buffer-menu)
;; Change the key binding for delete identation
(global-set-key "\M-\\" 'delete-indentation)
;; ERC
(setq erc-auto-query 'window-noselect)
;; Get rid of "text read only" error when trying to edit with helm
(setq inhibit-read-only t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Use packages
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(use-package exec-path-from-shell
:ensure t
:config
(push "HISTFILE" exec-path-from-shell-variables)
(setq exec-path-from-shell-check-startup-files nil)
(exec-path-from-shell-initialize))
(use-package recentf
:config
(recentf-mode)
(setq recentf-exclude '(".ido.last")
recentf-max-saved-items 1000)
(defun ido-recentf-open ()
"Use `ido-completing-read' to \\[find-file] a recent file"
(interactive)
(if (find-file (ido-completing-read "Find recent file: " recentf-list))
(message "Opening file...")
(message "Aborting")))
:bind (("C-x f" . ido-recentf-open)))
(use-package flycheck-clj-kondo
:ensure t)
(use-package clojure-mode
:ensure t
:mode (("\\.clj\\'" . clojure-mode)
("\\.edn\\'" . clojure-mode)
("\\.spec\\'" . clojure-mode))
:config
(require 'flycheck-clj-kondo)
:init
(add-hook 'clojure-mode-hook #'yas-minor-mode)
(add-hook 'clojure-mode-hook (if (fboundp 'display-line-numbers-mode)
#'display-line-numbers-mode
#'linum-mode))
(add-hook 'clojure-mode-hook #'subword-mode)
(add-hook 'clojure-mode-hook #'smartparens-mode)
(add-hook 'clojure-mode-hook #'rainbow-delimiters-mode)
(add-hook 'clojure-mode-hook #'eldoc-mode)
(add-hook 'clojure-mode-hook #'aggressive-indent-mode))
(setq-default
clojure-indent-style :always-align
evil-want-Y-yank-to-eol nil
neo-confirm-create-directory (quote off-p)
neo-confirm-create-file (quote off-p)
neo-theme (quote nerd))
(use-package paredit
:ensure t
:config
(add-hook 'clojure-mode-hook #'paredit-mode)
(add-hook 'emacs-lisp-mode-hook #'paredit-mode)
;; enable in the *scratch* buffer
(add-hook 'lisp-interaction-mode-hook #'paredit-mode)
(add-hook 'cider-repl-mode-hook #'paredit-mode)
(add-hook 'lisp-mode-hook #'paredit-mode)
(add-hook 'eval-expression-minibuffer-setup-hook #'paredit-mode))
(use-package cider
:ensure cider
:init
(setq cider-words-of-inspiration '("NREPL is ready!!"))
(progn
(add-hook 'cider-mode-hook 'my/setup-cider)
(add-hook 'cider-repl-mode-hook 'my/setup-cider)
(add-hook 'cider-mode-hook #'eldoc-mode)
(add-hook 'cider-repl-mode-hook #'eldoc-mode))
:bind (("TAB" . complete-symbol)))
(use-package winner ; Undo and redo window configurations
:init (winner-mode)
:bind (("C-c b" . winner-undo)
("C-c f" . winner-redo)))
(use-package rainbow-delimiters
:ensure
:init
(progn
(add-hook 'emacs-lisp-mode-hook (lambda()
(rainbow-delimiters-mode t)))))
;; highlight, navigate and edit symbols
(use-package auto-highlight-symbol
:ensure t
:diminish ""
:init
(add-hook 'prog-mode-hook 'auto-highlight-symbol-mode)
:config
(progn
(global-auto-highlight-symbol-mode +1)
(set-face-attribute 'ahs-face nil
:bold nil
:underline t
:background nil)
(set-face-attribute 'ahs-definition-face nil
:underline t
:bold t
:background nil)
(setq ahs-default-range 'ahs-range-whole-buffer
ahs-include "^[0-9A-Za-z/_.,:;*+=&%|$#@!^?>-]+$"
ahs-select-invisible 'temporary
ahs-idle-interval 0.25)
(bind-keys
:map auto-highlight-symbol-mode-map
("M-<left>" . nil)
("M-<right>" . nil)
("M-F" . ahs-forward)
("M-B" . ahs-backward)
("s-e" . ahs-edit-mode)
("s-f" . ahs-forward)
("s-F" . ahs-forward-definition)
("s-b" . ahs-backward)
("s-B" . ahs-backward-definition)
("M-E" . ahs-edit-mode))))
(use-package helm
:ensure t
:bind (("M-y" . helm-show-kill-ring)
("C-x C-b" . helm-buffers-list)
("C-c h o" . helm-occur)
("C-c h f" . helm-find-files)
("C-c h r" . helm-regexp)
("C-c h m" . helm-mark-ring)
("C-c h x" . helm-M-x)
("C-c h a" . helm-ag)
("C-c h t" . helm-do-ag)
("C-c h b" . helm-buffers-list)
("C-c h i" . helm-imenu))
:config
(progn
(require 'helm-config)
(require 'helm-ring)
(require 'helm-source)
(require 'helm-adaptive)
(use-package helm-ag :ensure t)
(setq helm-split-window-default-side 'below
helm-split-window-in-side-p t
helm-move-to-line-cycle-in-source t
helm-display-header-line nil
helm-candidate-separator "ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ")
(helm-autoresize-mode +1)))
;; TODO Projectile
(use-package magit
:ensure t)
;;ORG mode
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-cb" 'org-switchb)
;; MARKDOWN
(use-package markdown-mode
:ensure t
:commands (markdown-mode gfm-mode)
:mode (("README\\.md\\'" . gfm-mode)
("\\.md\\'" . markdown-mode)
("\\.markdown\\'" . markdown-mode))
:init (setq markdown-command "multimarkdown"))
(use-package flycheck-joker
:ensure t
:init (global-flycheck-mode))
;; el-get
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil 'noerror)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el")
(goto-char (point-max))
(eval-print-last-sexp)))
(add-to-list 'el-get-recipe-path "~/.emacs.d/el-get-user/recipes")
;; --------------- PYTHON STUFFS
(use-package python
:mode ("\\.py\\'" . python-mode)
:init
(setq python-shell-interpreter "/Library/Frameworks/Python.framework/Versions/3.8/bin/python3"))
;; Python editing
(use-package elpy
:ensure t
:after python
:config (elpy-enable))
(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 nil))
(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.
)