-
Notifications
You must be signed in to change notification settings - Fork 8
/
config.el
166 lines (139 loc) · 5.11 KB
/
config.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
;;; config.el --- The Configuration of the Boy
(defvar boy--synonyms-key ""
"API key from http://thesaurus.altervista.org that gives us synonyms.")
;; Private things others should not see ;D
(load! "+private" nil t) ; do not complain if file does not exist
;; Load personalized bindings
(load! "+bindings")
;; Personalized functions
(load! "+functions")
;; Anything that modifies the way popups spawn
(load! "+popups")
;; Theme related things
(load! "+themes")
;; Different config for different systems
(load! "+systems")
;; Patches of functions to fix other packages
(load! "+patches")
;; Configuration of DOOM lang
(load! "+latex")
(load! "+org")
(load! "+lang")
;; Configuration of DOOM checkers
(load! "+checkers")
;; Configuration of DOOM tools
(load! "+tools")
;; Configuration of DOOM ui
(load! "+ui")
;; Config of DOOM feature
(load! "+feature")
;; Config of DOOM completion
(load! "+completion")
;; Config of DOOM editor
(load! "+editor")
;; Config of DOOM term
(load! "+term")
;; Smooth mouse scrolling
(setq mouse-wheel-scroll-amount '(2 ((shift) . 1)) ; scroll two lines at a time
mouse-wheel-progressive-speed nil ; don't accelerate scrolling
mouse-wheel-follow-mouse t ; scroll window under mouse
scroll-step 1)
;; Backups
(setq make-backup-files t
backup-by-copying t
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t)
;; Favor visual line wrapping
(remove-hook 'text-mode-hook #'auto-fill-mode)
(add-hook 'text-mode-hook #'visual-line-mode)
;; Visual fill column mode by default
;;(setq visual-fill-column-width 120)
;;(add-hook! '(text-mode-hook prog-mode-hook) #'visual-fill-column-mode)
;; Window splitting logic
(setq window-combination-resize t ; after splitting, rebalance windows
window-combination-limit nil)
;; Custom split: always vertical except if average window column < 80
;(setq split-window-preferred-function #'+boy/split-window-sensibly)
;; Scrolling commands do not cancel isearch
(setq isearch-allow-scroll t)
;; Don't save undo history
(remove-hook 'undo-fu-mode-hook #'global-undo-fu-session-mode)
(after! undo-tree
(setq undo-tree-auto-save-history nil))
(after! ibuffer
;; nearly all of this is the default layout
(setq ibuffer-formats
'((mark modified read-only " "
(name 50 50 :left :elide) ; changed
" "
(size 9 -1 :right)
" "
(mode 16 16 :left :elide)
" " filename-and-process)
(mark " "
(name 16 -1)
" " filename))))
;; Pop mark improvements (http://endlessparentheses.com/faster-pop-to-mark-command.html)
;; pop mark as in C-u C-SPC C-SPC C-SPC ...
(setq set-mark-command-repeat-pop t)
;; Pop until marker actually moves
(advice-add 'pop-to-mark-command :around #'+boy/multi-pop-to-mark)
;; Enable narrow to region
(put 'narrow-to-region 'disabled nil)
;; Do not start auto start comments in new lines.
(setq +default-want-RET-continue-comments nil)
;; ---------------------------------------------------------------------------------
;; Additional Packages
;; ---------------------------------------------------------------------------------
;; Show me where I made the last change in a document.
(use-package! goto-last-change
:commands goto-last-change)
;; Resize windows interactively.
(use-package! resize-window
:commands (resize-window))
;; Latex synonyms
(use-package! www-synonyms
:if (not (or (null boy--synonyms-key) (string= "" boy--synonyms-key)))
:commands (www-synonyms-insert-synonym www-synonyms-change-language)
:config
(setq www-synonyms-key boy--synonyms-key))
(use-package! jupyter
;; :load-path ("~/src/emacs-jupyter" "~/src/emacs-zmq")
:after org
:init
(setq jupyter-eval-use-overlays t))
(use-package! pacfiles-mode
:commands (pacfiles pacfiles-start)
:config
(set-popup-rule! "^\\*pacfiles.*" :ignore t))
(when (not (boundp '+bibliography-notes-dir))
(setq +bibliography-notes-dir "~/documents/bib/"))
(use-package! command-log-mode
:commands global-command-log-mode
:init
(setq command-log-mode-auto-show t
command-log-mode-open-log-turns-on-mode t
command-log-mode-window-font-size 0
command-log-mode-window-size 80)
:config
(setq clm/log-command-exceptions*
(append clm/log-command-exceptions*
'(+boy/up-scroll
+boy/down-scroll))))
;; This variable should go inside of :init, but doesn't get called at the right time.
(setq lsp-tailwindcss-add-on-mode t)
(use-package! lsp-tailwindcss
:when (featurep! +lsp)
:after lsp-mode
:config
(setq lsp-tailwindcss-emmet-completions (featurep 'emmet-mode))
;; Advice that uses a locally installed rustywind binary.
(defun +rustywind-with-local-bin (orig-fun &rest args)
(let ((lsp-tailwindcss-rustywind-command
(concat (projectile-project-root)
"node_modules/.bin/rustywind")))
(apply orig-fun args)))
(advice-add #'lsp-tailwindcss-rustywind :around #'+rustywind-with-local-bin))
(set-docsets! '(web-mode css-mode rjsx-mode typescript-tsx-mode) :add "Tailwind_CSS")