-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemacs
251 lines (222 loc) · 12.1 KB
/
emacs
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
;; Arthur 2020
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
(when no-ssl
(warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
2. Remove this warning from your init file so you won't see it again."))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
(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.
'(ansi-color-faces-vector
[default default default italic underline success warning error])
'(ansi-color-names-vector
["#3c3836" "#fb4933" "#b8bb26" "#fabd2f" "#83a598" "#d3869b" "#8ec07c" "#ebdbb2"])
'(company-backends
(quote
(company-bbdb company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-files
(company-dabbrev-code company-gtags company-etags company-abbrev company-clang)
company-oddmuse company-dabbrev)))
'(completion-auto-help (quote lazy))
'(custom-enabled-themes (quote (doom-molokai)))
'(custom-safe-themes
(quote
("55c2c0d811cdecd311ebe27f82b24a5410d38c1ff6117c91e5ba88031829ee06" "1623aa627fecd5877246f48199b8e2856647c99c6acdab506173f9bb8b0a41ac" "fa3bdd59ea708164e7821574822ab82a3c51e262d419df941f26d64d015c90ee" "e1ef2d5b8091f4953fe17b4ca3dd143d476c106e221d92ded38614266cea3c8b" "1d50bd38eed63d8de5fcfce37c4bb2f660a02d3dff9cbfd807a309db671ff1af" "615123f602c56139c8170c153208406bf467804785007cdc11ba73d18c3a248b" "f9cae16fd084c64bf0a9de797ef9caedc9ff4d463dd0288c30a3f89ecf36ca7e" "285efd6352377e0e3b68c71ab12c43d2b72072f64d436584f9159a58c4ff545a" "229c5cf9c9bd4012be621d271320036c69a14758f70e60385e87880b46d60780" "51956e440cec75ba7e4cff6c79f4f8c884a50b220e78e5e05145386f5b381f7b" "58c3313b4811ed8b30239b1d04816f74d438bcb72626d68181f294b115b7220d" "7d708f0168f54b90fc91692811263c995bebb9f68b8b7525d0e2200da9bc903c" "c83c095dd01cde64b631fb0fe5980587deec3834dc55144a6e78ff91ebc80b19" "730a87ed3dc2bf318f3ea3626ce21fb054cd3a1471dcd59c81a4071df02cb601" "2cdc13ef8c76a22daa0f46370011f54e79bae00d5736340a5ddfe656a767fddf" "93ed23c504b202cf96ee591138b0012c295338f38046a1f3c14522d4a64d7308" "e1ecb0536abec692b5a5e845067d75273fe36f24d01210bf0aa5842f2a7e029f" "99ea831ca79a916f1bd789de366b639d09811501e8c092c85b2cb7d697777f93" "7c4cfa4eb784539d6e09ecc118428cd8125d6aa3053d8e8413f31a7293d43169" "d5f8099d98174116cba9912fe2a0c3196a7cd405d12fa6b9375c55fc510988b5" "7f791f743870983b9bb90c8285e1e0ba1bf1ea6e9c9a02c60335899ba20f3c94" "e074be1c799b509f52870ee596a5977b519f6d269455b84ed998666cf6fc802a" "dde8c620311ea241c0b490af8e6f570fdd3b941d7bc209e55cd87884eb733b0e" "f2b56244ecc6f4b952b2bcb1d7e517f1f4272876a8c873b378f5cf68e904bd59" "361f5a2bc2a7d7387b442b2570b0ef35198442b38c2812bf3c70e1e091771d1a" "d74c5485d42ca4b7f3092e50db687600d0e16006d8fa335c69cf4f379dbd0eee" "be9645aaa8c11f76a10bcf36aaf83f54f4587ced1b9b679b55639c87404e2499" "1ed5c8b7478d505a358f578c00b58b430dde379b856fbcb60ed8d345fc95594e" "0ad7f1c71fd0289f7549f0454c9b12005eddf9b76b7ead32a24d9cb1d16cbcbd" "6231254e74298a1cf8a5fee7ca64352943de4b495e615c449e9bb27e2ccae709" "56911bd75304fdb19619c9cb4c7b0511214d93f18e566e5b954416756a20cc80" "845103fcb9b091b0958171653a4413ccfad35552bc39697d448941bcbe5a660d" "6bacece4cf10ea7dd5eae5bfc1019888f0cb62059ff905f37b33eec145a6a430" "24132f7b6699c6e0118d742351b74141bac3c4388937e40db9207554eaae78c9" "bc836bf29eab22d7e5b4c142d201bcce351806b7c1f94955ccafab8ce5b20208" "a83f05e5e2f2538376ea2bfdf9e3cd8b7f7593b16299238c1134c1529503fa88" "9b01a258b57067426cc3c8155330b0381ae0d8dd41d5345b5eddac69f40d409b" "3577ee091e1d318c49889574a31175970472f6f182a9789f1a3e9e4513641d86" "d71aabbbd692b54b6263bfe016607f93553ea214bc1435d17de98894a5c3a086" "76bfa9318742342233d8b0b42e824130b3a50dcc732866ff8e47366aed69de11" "1526aeed166165811eefd9a6f9176061ec3d121ba39500af2048073bea80911e" "f633d825e380caaaefca46483f7243ae9a663f6df66c5fad66d4cab91f731c86" "7023f8768081cd1275f7fd1cd567277e44402c65adfe4dc10a3a908055ed634d" "86704574d397606ee1433af037c46611fb0a2787e8b6fd1d6c96361575be72d2" "8e797edd9fa9afec181efbfeeebf96aeafbd11b69c4c85fa229bb5b9f7f7e66c" "2b9dc43b786e36f68a9fd4b36dd050509a0e32fe3b0a803310661edb7402b8b6" "1436d643b98844555d56c59c74004eb158dc85fc55d2e7205f8d9b8c860e177f" "b583823b9ee1573074e7cbfd63623fe844030d911e9279a7c8a5d16de7df0ed0" "585942bb24cab2d4b2f74977ac3ba6ddbd888e3776b9d2f993c5704aa8bb4739" "8f97d5ec8a774485296e366fdde6ff5589cf9e319a584b845b6f7fa788c9fa9a" "a22f40b63f9bc0a69ebc8ba4fbc6b452a4e3f84b80590ba0a92b4ff599e53ad0" default)))
'(fci-rule-color "#6272a4")
'(fringe-mode 6 nil (fringe))
'(inhibit-startup-screen t)
'(jdee-db-active-breakpoint-face-colors (cons "#1E2029" "#bd93f9"))
'(jdee-db-requested-breakpoint-face-colors (cons "#1E2029" "#50fa7b"))
'(jdee-db-spec-breakpoint-face-colors (cons "#1E2029" "#565761"))
'(linum-format " %7d ")
'(objed-cursor-color "#ff5555")
'(org-support-shift-select t)
'(package-check-signature nil)
'(package-selected-packages
(quote
(haskell-mode smart-hungry-delete sublimity yaml-mode dockerfile-mode org-bullets htmlize selectric-mode dumb-jump which-key company-irony-c-headers company-c-headers company-irony company irony wakatime-mode dracula-theme doom-themes rebecca-theme purple-haze-theme xresources-theme neotree yasnippet zone-nyan multiple-cursors smartparens powerline expand-region gruvbox-theme ace-jump-mode)))
'(pdf-view-midnight-colors (quote ("#282828" . "#f9f5d7")))
'(rustic-ansi-faces
["#282a36" "#ff5555" "#50fa7b" "#f1fa8c" "#61bfff" "#ff79c6" "#8be9fd" "#f8f8f2"])
'(vc-annotate-background "#282a36")
'(vc-annotate-color-map
(list
(cons 20 "#50fa7b")
(cons 40 "#85fa80")
(cons 60 "#bbf986")
(cons 80 "#f1fa8c")
(cons 100 "#f5e381")
(cons 120 "#face76")
(cons 140 "#ffb86c")
(cons 160 "#ffa38a")
(cons 180 "#ff8ea8")
(cons 200 "#ff79c6")
(cons 220 "#ff6da0")
(cons 240 "#ff617a")
(cons 260 "#ff5555")
(cons 280 "#d45558")
(cons 300 "#aa565a")
(cons 320 "#80565d")
(cons 340 "#6272a4")
(cons 360 "#6272a4")))
'(vc-annotate-very-old-color nil)
'(wakatime-cli-path "/usr/bin/wakatime")
'(wakatime-python-bin 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.
'(default ((t (:family "Iosevka Term" :foundry "xos4" :slant normal :weight normal :height 120 :width normal)))))
(require 'ace-jump-mode)
(define-key global-map (kbd "C-c SPC") 'ace-jump-mode)
(require 'expand-region)
(global-set-key (kbd "C-=") 'er/expand-region)
;; multiple cursors
(global-set-key (kbd "C-c a") 'mc/mark-all-like-this)
(global-set-key (kbd "C-c <down>") 'mc/mark-next-lines)
(global-set-key (kbd "C-S-<mouse-1>") 'mc/add-cursor-on-click)
;; No decorations
(tool-bar-mode -1)
(scroll-bar-mode -1)
(menu-bar-mode -1)
(global-hl-line-mode 1)
;; Search with mark
(defun jrh-isearch-with-region ()
"Use region as the isearch text."
(when mark-active
(let ((region (funcall region-extract-function nil)))
(deactivate-mark)
(isearch-push-state)
(isearch-yank-string region))))
(add-hook 'isearch-mode-hook #'jrh-isearch-with-region)
(global-set-key (kbd "<C-tab>") 'other-window)
;; y or n instead of yes or no
(fset 'yes-or-no-p 'y-or-n-p)
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
(delete-selection-mode 1)
;; Case insensitive open file
(setq read-file-name-completion-ignore-case 1)
;; Cute powerline
(require 'powerline)
(powerline-center-theme)
;; auto close parens and more
(require 'smartparens-config)
(smartparens-global-mode 1)
;; Move lline with alt key VScode-like
(defun move-line-up ()
"Move up the current line."
(interactive)
(transpose-lines 1)
(forward-line -2)
(indent-according-to-mode))
(defun move-line-down ()
"Move down the current line."
(interactive)
(forward-line 1)
(transpose-lines 1)
(forward-line -1)
(indent-according-to-mode))
(global-set-key (kbd "M-<up>") 'move-line-up)
(global-set-key (kbd "M-<down>") 'move-line-down)
(global-set-key (kbd "M-p") 'neotree-toggle)
(show-paren-mode 1)
(require 'yasnippet)
(yas-global-mode 1)
;; Startup screen
(require 'dashboard)
(dashboard-setup-startup-hook)
(setq dashboard-center-content t)
(setq dashboard-items '((recents . 5)
(bookmarks .10)))
(setq dashboard-set-file-icons t)
(setq dashboard-startup-banner 'logo)
(sp-pair "'" "'") ;; normal quote bug
(setq echo-keystrokes 0.1) ;; instantly show keystrokes
;; remove whitespace
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(put 'downcase-region 'disabled nil)
(global-wakatime-mode)
(global-set-key (kbd "C-c u") 'uncomment-region)
;; company/irony setup
;;
;; Add yasnippet support for all company backends
(defvar company-mode/enable-yas t
"Enable yasnippet for all backends.")
(defun company-mode/backend-with-yas (backend)
(if (or (not company-mode/enable-yas) (and (listp backend) (member 'company-yasnippet backend)))
backend
(append (if (consp backend) backend (list backend))
'(:with company-yasnippet))))
(require 'company)
(add-hook 'after-init-hook 'global-company-mode)
(eval-after-load 'company
'(add-to-list 'company-backends 'company-irony))
; Use tab key to cycle through suggestions.
;; (company-tng-configure-default)
(setq company-backends (mapcar #'company-mode/backend-with-yas company-backends))
(setq company-idle-delay 0)
(setq company-minimum-prefix-length 1)
(setq company-selection-wrap-around t)
;; irony autocomplete
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
(add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)
;; (setq company-backends (delete 'company-semantic company-backends))
(require 'company-irony-c-headers)
(eval-after-load 'company
'(add-to-list
'company-backends '(company-irony-c-headers company-irony)))
(add-to-list 'company-backends 'company-c-headers)
(add-hook 'prog-mode-hook 'dumb-jump-mode)
;; To go back use
(defun dumb-jump-and-message()
(interactive)
(dumb-jump-go)
(message "dumb-jump says: Use C-M-p to go back"))
(global-set-key (kbd "M-.") 'dumb-jump-and-message)
;; which key cheatsheet
(require 'which-key)
(which-key-mode)
(ido-mode t)
(setq ido-everywhere t
ido-enable-prefix nil
ido-enable-flex-matching t
ido-auto-merge-work-directories-length nil
;;ido-use-filename-at-point t
ido-max-prospects 10
ido-create-new-buffer 'always
;; ido-use-virtual-buffers t
;; ido-handle-duplicate-virtual-buffers 2
ido-default-buffer-method 'selected-window
ido-default-file-method 'selected-window)
(setq ido-decorations (quote ("\n-> " "" "\n " "\n ..." "[" "]" "
[No match]" " [Matched]" " [Not readable]" " [Too big]" "
[Confirm]")))
(defun ido-disable-line-truncation () (set (make-local-variable 'truncate-lines) nil))
(add-hook 'ido-minibuffer-setup-hook 'ido-disable-line-truncation)
;; orgmode capturing
(global-set-key (kbd "C-c c") 'org-capture)
(setq org-default-notes-file "~/ideas.org")
(add-hook 'org-mode-hook 'visual-line-mode)
(add-hook 'org-mode-hook 'org-bullets-mode)
;; Dockerfile support
(require 'dockerfile-mode)
(add-to-list 'auto-mode-alist '("Dockerfile\\'" . dockerfile-mode))
(setq create-lockfiles nil)