blob: a0751f51b4d31a224caca25feb25d7571e7221d6 (
plain)
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
|
#+TITLE: emprespresso's settings
#+AUTHOR: emprespresso
#+STARTUP: fold
* melpa
#+BEGIN_SRC emacs-lisp
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
#+END_SRC
* macos hacks that have to be run before most stuff.
** image types.
#+BEGIN_SRC emacs-lisp
(setq image-types '(svg png gif tiff jpeg xpm xbm pbg))
#+END_SRC
* yeah, be evil. whatcha gonna do about it?? huh?? >:P
#+BEGIN_SRC emacs-lisp
(use-package evil
:init
(setq evil-want-integration t)
(setq evil-want-keybinding nil)
(setq evil-want-C-u-scroll t)
(setq evil-want-C-i-jump nil)
(setq evil-shift-width {{ editorconfig.tab_width }})
(setq evil-cross-lines t)
(setq evil-respect-visual-line-mode t)
(setq evil-vsplit-window-below t)
(setq evil-split-window-below t)
(setq evil-undo-system 'undo-redo)
:config
(evil-mode 1)
(define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state)
(evil-global-set-key 'motion "j" 'evil-next-visual-line)
(evil-global-set-key 'motion "k" 'evil-previous-visual-line)
(add-hook 'evil-visual-activate-hook
#'(lambda ()
(global-hl-line-mode 0)))
(add-hook 'evil-visual-deactivate-hook
#'(lambda ()
(global-hl-line-mode 1)))
(setq evil-want-fine-undo t)
(evil-set-initial-state 'messages-buffer-mode 'normal))
#+END_SRC
* misc. emacs stuff
** files and autosaves
#+BEGIN_SRC emacs-lisp
(setq auto-save-default nil
make-backup-files nil
create-lockfiles nil)
(global-auto-revert-mode t) ;; Change files on disk as they are updated
#+END_SRC
** env.PATH
#+BEGIN_SRC emacs-lisp
(use-package exec-path-from-shell
:ensure t
:init
(when (memq window-system '(mac ns x))
(exec-path-from-shell-initialize)))
#+END_SRC
** case-region
#+BEGIN_SRC emacs-lisp
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)
#+END_SRC
** silence, bell
#+BEGIN_SRC emacs-lisp
(setq ring-bell-function 'ignore)
#+END_SRC
* appearance
** global
#+BEGIN_SRC emacs-lisp
;; > expert users often turn off the menu bar
;; > https://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bars.html
;; we're experts, right?? (*^.^*)
(menu-bar-mode -1)
;; don't show startup screen, go straight to scratch
(setq inhibit-startup-screen t)
#+END_SRC
** gui
*** clutter
#+BEGIN_SRC emacs-lisp
;; don't show clutter
(tool-bar-mode -1)
;; make line-wrap arrows basically invisible by setting the fringe area
;; dimensions to 1
(set-fringe-mode '(1 . 1))
;; disable scroll bars
(scroll-bar-mode -1)
(horizontal-scroll-bar-mode -1)
#+END_SRC
*** line - related
#+BEGIN_SRC emacs-lisp
;; move by whole line units, not visually
(setq line-move-visual nil)
;; make comfy
(setq line-spacing 0.24)
;; highlight current line
(global-hl-line-mode)
;; fixes an "issue", where the frame doesn't use the entire space available given
;; by the window manager since the frame will resize only by factors of the line
;; height by default.
;; especially noticeable when tiling ヽ(ー_ー )ノ
(setq frame-resize-pixelwise t)
#+END_SRC
*** transparency
#+BEGIN_SRC emacs-lisp
(set-frame-parameter (selected-frame) 'alpha '(94 94))
(add-to-list 'default-frame-alist '(alpha 94 94))
#+END_SRC
*** icons
must run ~(all-the-icons-install-fonts)~ and ~(nerd-fonts-install-fonts)~
#+BEGIN_SRC emacs-lisp
(use-package all-the-icons
:ensure t)
(use-package nerd-icons
:ensure t)
#+END_SRC
*** modeline
#+BEGIN_SRC emacs-lisp
(use-package doom-modeline
:ensure t
:config
(doom-modeline-mode 1))
#+END_SRC
*** themes
#+BEGIN_SRC emacs-lisp
(use-package doom-themes
:ensure t
:config
(setq doom-themes-enable-bold t ; enable bold globally
doom-themes-enable-italic t) ; enable italics globally
;; flash mode-line on errors
(doom-themes-visual-bell-config)
(doom-themes-neotree-config)
;; corrects (and improves) org-mode's native fontification.
(doom-themes-org-config))
#+END_SRC
*** eager loading of theme
#+BEGIN_SRC emacs-lisp
;; TODO: figure out why this won't work when this is a symlink.
(setq *theme-file* "~/.config/theme/emacs.el")
(defun lazy-theme (event)
(message "Event %S" event)
(load-file *theme-file*))
(file-notify-add-watch *theme-file* '(change attribute-change)
'lazy-theme)
(lazy-theme nil)
#+END_SRC
* neotree
#+BEGIN_SRC emacs-lisp
(use-package neotree
:ensure t
:bind ("C-c j" . 'neotree-toggle)
:init
;; slow rendering
(setq inhibit-compacting-font-caches t)
;; set icons theme
(setq neo-theme (if (display-graphic-p) 'icons 'arrow))
(setq neo-window-width 35)
;; every time when the neotree window is opened, let it find current file
;; and jump to node
(setq neo-smart-open t)
;; when running ‘projectile-switch-project’ (C-c p p), ‘neotree’
;; will change root automatically
(setq projectile-switch-project-action 'neotree-projectile-action)
;; show hidden files
(setq-default neo-show-hidden-files t))
#+END_SRC
* org mode
** misc vars
#+BEGIN_SRC emacs-lisp
(setq org-startup-indented t
org-html-postamble nil
org-html-preamble t
org-src-tab-acts-natively t)
#+END_SRC
** roam
#+BEGIN_SRC emacs-lisp
(use-package org-roam
:straight t)
#+END_SRC
** babel
#+BEGIN_SRC emacs-lisp
(org-babel-do-load-languages
'org-babel-load-languages
'((lisp . t)
(emacs-lisp . t)
(python . t)))
#+END_SRC
** org-bullets
#+BEGIN_SRC emacs-lisp
(use-package org-bullets
:ensure t
:init
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
#+END_SRC
** org-appear
#+BEGIN_SRC emacs-lisp
(use-package org-appear
:ensure t
:init
(add-hook 'org-mode-hook 'org-appear-mode))
#+END_SRC
** presentations
#+BEGIN_SRC emacs-lisp
(use-package org-present
:ensure t
:straight '(org-present
:type git
:host github
:repo "rlister/org-present"))
#+END_SRC
* major modes
** markdown
#+BEGIN_SRC emacs-lisp
(use-package markdown-mode
:ensure t
:mode ("README\\.md\\'" . gfm-mode)
:init (setq markdown-command "multimarkdown")
:bind (:map markdown-mode-map
("C-c C-e" . markdown-do)))
#+END_SRC
* dev stuff
** completion
#+BEGIN_SRC emacs-lisp
;; > yasnippet is a template system for emacs.
;; > it allows you to type an abbreviation and automatically expand it into
;; function templates.
;; https://github.com/joaotavora/yasnippet/blob/master/README.mdown
(use-package yasnippet
:ensure t
:init (yas-global-mode 1))
#+END_SRC
** lsp
#+BEGIN_SRC emacs-lisp
;; pip3 install epc orjson sexpdata six setuptools \
;; paramiko rapidfuzz watchdog packaging
(use-package lsp-bridge
:straight
'(lsp-bridge :type git :host github
:repo "manateelazycat/lsp-bridge"
:files (:defaults
"*.el" "*.py" "acm" "core" "langserver"
"multiserver" "resources")
:build (:not compile))
:init (global-lsp-bridge-mode))
#+END_SRC
** format
#+BEGIN_SRC emacs-lisp
(use-package format-all
:ensure t
:bind (("C-c C-f" . format-all-region)))
#+END_SRC
|