-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.el
More file actions
370 lines (324 loc) · 10.2 KB
/
Copy pathinit.el
File metadata and controls
370 lines (324 loc) · 10.2 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
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
;; Copyright (c) 2019-2026 cmburn <me@cmburn.dev>
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;; Pull in straight.el, our package manager of choice
(require 'use-package-ensure)
(defvar bootstrap-version)
;; Custom functions/variables
(defcustom display-line-numbers-exempt-modes
'(eshell-mode
shell-mode
matlab-shell-mode
treemacs-mode
help-mode
dashboard-mode)
"Major modes on which to disable line numbers."
:group 'display-line-numbers
:type 'list
:version "green")
(defcustom display-fill-column-indicator-exempt-modes
'(dashboard-mode
matlab-shell-mode)
"Major modes on which to disable the display fill column indicator"
:group 'display-fill-column-indicator
:type 'list)
(defcustom tabless-modes
'("*LSP"
"*straight"
"*Messages"
"*lsp"
"*digestif"
"*helm"
"*Flycheck"
"*company"
"*epc"
"*helm"
"*Helm"
"*Compile-Log*"
"*lsp"
"*company"
"*Flycheck"
"*tramp"
" *Mini"
"*help"
"*straight"
" *temp"
"*Help"
"*mybuf")
""
:group 'tab
:type 'list)
(defun centaur-tabs-hide-tab (x)
"Do no to show buffer X in tabs."
(let ((name (format "%s" x)))
(or
;; Current window is not dedicated window.
(window-dedicated-p (selected-window))
(some (lambda (str)
(string-prefix-p str)) tabless-modes)
;; Is not magit buffer.
(and (string-prefix-p "magit" name)
(not (file-name-extension name))))))
(defcustom ui-size
120
""
:group 'font
:type 'integer)
(defcustom ui-font
"Cantarell"
""
:group 'font
:type 'string)
(defun mark-ui-font (font &optional size-in)
(let ((fonts (if (listp font) font '(font))))
(mapcar
(lambda (f)
(let ((size (if size-in size-in ui-size)))
(set-face-attribute
f nil
:family ui-font
:height size
:spacing (* size 1.1)))))))
(defun disable-exempt-modes ()
"Disable exempt modes after a mode change"
(display-line-numbers-mode
(if (derived-mode-p display-line-numbers-exempt-modes)
0
1))
(display-fill-column-indicator-mode
(if (derived-mode-p display-fill-column-indicator-exempt-modes)
0
1)))
(defun mark-ui-font (face-arg)
(let ((faces (if (listp face-arg)
face-arg
'(face-arg))))
(mapcar
(lambda (arg)
(set-face-font arg ui-font))
face-arg)))
(defun highlight-trailing-whitespace ()
"Highlight trailing whitespace in the current buffer."
(setq show-trailing-whitespace t))
(use-package emacs
:bind
(("C-s" . isearch-forward-regexp)
("C-r" . i-search-backward-regexp)
("C-M-s" . isearch-forward)
("C-M-s" . isearch-backward))
:hook ((text-mode . display-fill-column-indicator-mode)
(text-mode . display-line-numbers-mode)
(after-change-major-mode . disable-exempt-modes)
(tex-mode . flycheck-mode)
(text-mode . highlight-trailing-whitespace))
:init
(setq blink-matching-paren 1)
(setq case-replace nil)
(setq comp-async-report-warnings-errors nil)
(setq query-replace-highlight 1)
(setq require-final-newline 1)
(setq show-paren-delay 0 show-paren-style 'parenthesis)
(setq warning-suppress-log-types '((comp)))
(setq warning-suppress-types '((comp)))
(setq backup-directory-alist '(("." . "~/.emacs-backups.d/")))
(setq-default buffer-file-coding-system 'utf-8-unix)
(setq-default fill-column 80)
(setq-default truncate-lines 1)
(setq dashboard-center-content t)
(setq doom-modeline-height 32)
(setq doom-modeline-icon t)
(setq safe-local-variable-values '((eval cperl-set-style "PBP")))
(setq search-highlight 1)
(setq treemacs-width 24)
(setq load-path (cons "~/.emacs.d/elisp/" load-path))
(setq whitespace-style
'(trailing lines space-before-tab)
whitespace-line-column 80)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el"
user-emacs-directory))
(bootstrap-version 6))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
(concat "https://raw.githubusercontent.com/"
"radian-software/straight.el/develop/install.el")
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(setq straight-use-package-by-default 't)
(setq use-package-always-ensure t)
:config
(scroll-bar-mode -1)
(electric-pair-mode 1)
(put 'downcase-region 'disabled nil)
(put 'narrow-to-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(global-display-line-numbers-mode)
(line-number-mode 1)
(show-paren-mode 1)
(tool-bar-mode -1)
(auto-compression-mode 1)
(transient-mark-mode 1))
(use-package exec-path-from-shell
:if (display-graphic-p)
:config
(setq exec-path-from-shell-debug 't)
(exec-path-from-shell-initialize))
(use-package doom-modeline
:init
(setq doom-modeline-height 32)
(setq doom-modeline-icon t)
:config
(doom-modeline-mode)
(set-face-attribute 'doom-modeline nil :family ui-font :height ui-size))
(use-package doom-themes
:config
(load-theme 'doom-one t))
(use-package anzu
:bind ("M-%" . anzu-query-replace-regexp))
(use-package helm
:config (helm-mode t)
:bind
(("C-h a" . helm-apropos)
("C-x C-f" . helm-find-files)
("M-x" . helm-M-x)))
(use-package company
:hook ((after-init . global-company-mode)))
(use-package treemacs
:bind ("M-1" . treemacs)
:config
(mark-ui-font
'(treemacs-directory-face
treemacs-directory-collapsed-face
treemacs-file-face
treemacs-root-face
treemacs-root-unreadable-face
treemacs-root-remote-face
treemacs-root-remote-unreadable-face
treemacs-root-remote-disconnected-face
treemacs-git-added-face
treemacs-git-commit-diff-face
treemacs-git-conflict-face
treemacs-git-ignored-face
treemacs-git-modified-face
treemacs-git-renamed-face
treemacs-git-unmodified-face
treemacs-git-untracked-face
treemacs-tags-face
treemacs-help-title-face
treemacs-help-column-face)))
(use-package dashboard
:config
(dashboard-setup-startup-hook))
(use-package rust-mode)
(use-package lsp-mode
:init
(use-package lsp-treemacs
:bind ("M-6" . lsp-treemacs-errors-list))
(use-package dap-mode)
:hook ((c-mode-common . lsp)
(go-mode . lsp)
(elixir-ts-mode . lsp)
(heex-ts-mode . lsp)
(rust-mode . lsp)))
(use-package font-utils)
(use-package all-the-icons
:if (display-graphic-p))
(use-package projectile
:init
(use-package helm-projectile)
(use-package treemacs-projectile))
(use-package editorconfig)
(use-package tree-sitter)
(use-package solaire-mode
:config
(solaire-global-mode +1))
(use-package centaur-tabs
:config
(centaur-tabs-change-fonts ui-font ui-size)
(centaur-tabs-mode t)
(setq centaur-tabs-height 32)
(setq centaur-tabs-set-icons t)
(setq centaur-tabs-icon-type 'all-the-icons)
(setq centaur-tabs-style "bar"))
(use-package flycheck)
(use-package vterm)
(use-package auctex
:hook ((LaTeX-mode . lsp)
(LaTeX-mode . flycheck-mode)))
(use-package matlab-mode)
(use-package bison-mode)
(use-package crystal-mode
:hook ((crystal-mode . lsp)))
(use-package glsl-mode
:ensure t)
(use-package elixir-ts-mode
:ensure t
:config
(require 'dap-elixir))
(use-package protobuf-mode
:ensure t
:config (setq lsp-buf-path "~/.local/bin/buf")
:hook ((protobuf-mode . lsp)))
(use-package yasnippet
:ensure t
:config
(yas-global-mode 1))
(use-package magit
:ensure t)
(use-package copilot
:ensure t
:hook (prog-mode . copilot-mode)
:bind (:map copilot-completion-map
("<tab>" . copilot-accept-completion)
("TAB" . copilot-accept-completion)
("C-<tab>" . copilot-accept-completion-by-word)
("C-TAB" . copilot-accept-completion-by-word)
("C-n" . copilot-next-completion)
("C-p" . copilot-previous-completion)))
;; https://github.com/mickeynp/ligature.el
(use-package ligature
:ensure t
:config
(ligature-set-ligatures
'prog-mode
'("--" "---" "==" "===" "!=" "!==" "=!="
"=:=" "=/=" "<=" ">=" "&&" "&&&" "&=" "++" "+++" "***" ";;" "!!"
"??" "???" "?:" "?." "?=" "<:" ":<" ":>" ">:" "<:<" "<>" "<<<" ">>>"
"<<" ">>" "||" "-|" "_|_" "|-" "||-" "|=" "||=" "##" "###" "####"
"#{" "#[" "]#" "#(" "#?" "#_" "#_(" "#:" "#!" "#=" "^=" "<$>" "<$"
"$>" "<+>" "<+" "+>" "<*>" "<*" "*>" "</" "</>" "/>" "<!--" "<#--"
"-->" "->" "->>" "<<-" "<-" "<=<" "=<<" "<<=" "<==" "<=>" "<==>"
"==>" "=>" "=>>" ">=>" ">>=" ">>-" ">-" "-<" "-<<" ">->" "<-<" "<-|"
"<=|" "|=>" "|->" "<->" "<~~" "<~" "<~>" "~~" "~~>" "~>" "~-" "-~"
"~@" "[||]" "|]" "[|" "|}" "{|" "[<" ">]" "|>" "<|" "||>" "<||"
"|||>" "<|||" "<|>" "..." ".." ".=" "..<" ".?" "::" ":::" ":=" "::="
":?" ":?>" "//" "///" "/*" "*/" "/=" "//=" "/==" "@_" "__" "???"
"<:<" ";;;"))
(global-ligature-mode t))
(use-package claude-code-ide
:straight (:type git :host github :repo "manzaltu/claude-code-ide.el")
:bind ("C-c C-'" . claude-code-ide-menu)
:config (claude-code-ide-emacs-tools-setup))
(setq treesit-language-source-alist
'((cmake "https://github.com/uyha/tree-sitter-cmake")
(elixir "https://github.com/elixir-lang/tree-sitter-elixir")
(javascript "https://github.com/tree-sitter/tree-sitter-javascript")
(json "https://github.com/tree-sitter/tree-sitter-json")
(make "https://github.com/alemuller/tree-sitter-make")
(markdown "https://github.com/ikatyang/tree-sitter-markdown")
(elisp "https://github.com/Wilfred/tree-sitter-elisp")
(heex "https://github.com/phoenixframework/tree-sitter-heex")))
(setq safe-local-variable-directories '("/home/cmburn/src/dail_umbrella/"))
(add-to-list 'default-frame-alist
'(font . "JetBrains Mono-9"))