blob: 1763def4d7a42632c842a4dcb26a986e49195470 (
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
|
#+title: Emacs Programming Language Setup
* Shell Script
Run =eglot= on shell script files.
#+begin_src emacs-lisp
(add-hook 'sh-mode-hook 'jj/eglot-setup)
#+end_src
* C
Run =eglot= on C and C++ files.
#+begin_src emacs-lisp
(add-hook 'c-mode-hook 'jj/eglot-setup)
(add-hook 'c++-mode-hook 'jj/eglot-setup)
(add-hook 'cc-mode-hook 'jj/eglot-setup)
#+end_src
Run =eglot= on CMake files.
#+begin_src emacs-lisp
(use-package cmake-mode
:init
(add-hook 'cmake-mode-hook 'jj/eglot-setup))
#+end_src
Turn off C mode in =lex= and =yacc= files.
#+begin_src emacs-lisp
(add-to-list 'auto-mode-alist '("\\.l$" . prog-mode))
(add-to-list 'auto-mode-alist '("\\.y$" . prog-mode))
#+end_src
* Web
Run =eglot= on HTML files.
#+begin_src emacs-lisp
(add-hook 'html-mode-hook 'jj/eglot-setup)
#+end_src
Run =eglot= on CSS files.
#+begin_src emacs-lisp
(add-hook 'css-mode-hook 'jj/eglot-setup)
#+end_src
Run =eglot= on JavaScript files.
#+begin_src emacs-lisp
(add-hook 'js-json-mode-hook 'jj/eglot-setup)
(add-hook 'js-mode-hook 'jj/eglot-setup)
#+end_src
* Python
Run =eglot= on Python files.
#+begin_src emacs-lisp
(add-hook 'python-mode-hook 'jj/eglot-setup)
#+end_src
* Go
Install Go support and run =eglot= on Go files.
#+begin_src emacs-lisp
(use-package go-mode
:init
(add-hook 'go-mode-hook 'jj/eglot-setup))
#+end_src
Get documentation for Go variables, functions, and arguments.
#+begin_src emacs-lisp
(use-package go-eldoc
:init
(add-hook 'go-mode-hook 'go-eldoc-setup))
#+end_src
Automatically generate tests in Go.
#+begin_src emacs-lisp
(use-package go-gen-test)
#+end_src
Get refactoring tools from =go-guru=.
#+begin_src emacs-lisp
(use-package go-guru
:hook (go-mode . go-guru-hl-identifier-mode))
#+end_src
* Lua
Install Lua support and run =eglot= on Lua files.
#+begin_src emacs-lisp
(use-package lua-mode
:init
(add-hook 'lua-mode-hook 'jj/eglot-setup))
#+end_src
Better Lisp editing with =lispy=.
#+begin_src emacs-lisp
(use-package lispy
:hook (emacs-lisp-mode . lispy-mode))
(use-package lispyville
:after lispy
:hook (lispy-mode . lispyville-mode))
#+end_src
Better parentheses handling in lisp with =parinfer-rust-mode=.
#+begin_src emacs-lisp
(use-package parinfer-rust-mode
:hook (emacs-lisp-mode . parinfer-rust-mode)
:init
(setq parinfer-rust-auto-download t))
#+end_src
* Markdown
Install Markdown support and run =eglot= on Markdown files.
#+begin_src emacs-lisp
(use-package markdown-mode
:init
(add-hook 'markdown-mode-hook 'jj/eglot-setup))
(add-hook 'markdown-mode-hook 'variable-pitch-mode)
(custom-set-faces
`(variable-pitch ((t :font ,jj/var-font)))
`(fixed-pitch ((t :font ,jj/mono-font)))
'(markdown-header-face ((t (:inherit variable-pitch :weight bold))))
'(markdown-header-face-1 ((t (:inherit markdown-header-face :height 2.0))))
'(markdown-header-face-2 ((t (:inherit markdown-header-face :height 1.75))))
'(markdown-header-face-3 ((t (:inherit markdown-header-face :height 1.5))))
'(markdown-header-face-4 ((t (:inherit markdown-header-face :height 1.25))))
'(markdown-header-face-5 ((t (:inherit markdown-header-face :height 1.1))))
'(markdown-header-face-6 ((t (:inherit markdown-header-face :height 1.1))))
'(markdown-blockquote-face ((t (:inherit fixed-pitch))))
'(markdown-code-face ((t (:inherit fixed-pitch))))
'(markdown-html-attr-name-face ((t (:inherit fixed-pitch))))
'(markdown-html-attr-value-face ((t (:inherit fixed-pitch))))
'(markdown-html-entity-face ((t (:inherit fixed-pitch))))
'(markdown-html-tag-delimiter-face ((t (:inherit fixed-pitch))))
'(markdown-html-tag-name-face ((t (:inherit fixed-pitch))))
'(markdown-comment-face ((t (:inherit fixed-pitch))))
'(markdown-header-delimiter-face ((t (:inherit fixed-pitch))))
'(markdown-hr-face ((t (:inherit fixed-pitch))))
'(markdown-inline-code-face ((t (:inherit fixed-pitch))))
'(markdown-language-info-face ((t (:inherit fixed-pitch))))
'(markdown-language-keyword-face ((t (:inherit fixed-pitch))))
'(markdown-link-face ((t (:inherit fixed-pitch))))
'(markdown-markup-face ((t (:inherit fixed-pitch))))
'(markdown-math-face ((t (:inherit fixed-pitch))))
'(markdown-metadata-key-face ((t (:inherit fixed-pitch))))
'(markdown-metadata-value-face ((t (:inherit fixed-pitch))))
'(markdown-missing-link-face ((t (:inherit fixed-pitch))))
'(markdown-plain-url-face ((t (:inherit fixed-pitch))))
'(markdown-reference-face ((t (:inherit fixed-pitch))))
'(markdown-table-face ((t (:inherit fixed-pitch))))
'(markdown-url-face ((t (:inherit fixed-pitch)))))
(add-hook 'markdown-mode-hook 'visual-line-mode)
(add-hook 'markdown-mode-hook #'(lambda () (display-line-numbers-mode -1)))
(defun jj/markdown-mode-visual-fill ()
(setq visual-fill-column-width 100
visual-fill-column-center-text t)
(visual-fill-column-mode 1))
(add-hook 'markdown-mode-hook #'jj/markdown-mode-visual-fill)
(setq markdown-hide-markup t)
#+end_src
* LaTeX
Run =eglot= on TeX files.
#+begin_src emacs-lisp
(add-hook 'tex-mode-hook 'jj/eglot-setup)
#+end_src
Use AUCTeX for extra LaTeX integration.
#+begin_src emacs-lisp
(use-package auctex
:config
(add-hook 'LaTeX-mode-hook 'jj/eglot-setup)
(add-hook 'LaTeX-mode-hook
(lambda ()
(put 'LaTeX-mode 'eglot-language-id "latex"))))
#+end_src
Use CDLaTeX for environment and macro insertion.
#+begin_src emacs-lisp
(use-package cdlatex
:config
(add-hook 'LaTeX-mode-hook #'turn-on-cdlatex))
#+end_src
Use =latex-preview-pane= to see the PDF automatically.
#+begin_src emacs-lisp
(use-package latex-preview-pane
:config
(latex-preview-pane-enable))
#+end_src
* YAML
Install YAML support and run =eglot= on YAML files.
#+begin_src emacs-lisp
(use-package yaml-mode
:init
(add-hook 'yaml-mode-hook 'jj/eglot-setup))
#+end_src
* Nix
Install =nix= support and run =eglot= on =nix= files.
#+begin_src emacs-lisp
(use-package nix-mode
:mode "\\.nix\\'")
#+end_src
|