-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcrescentrose.txt
331 lines (267 loc) · 15.1 KB
/
crescentrose.txt
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
*crescentrose.txt* Config Overview March 2024
*crescentrose
==============================================================================
CONTENTS *CRContents*
1. Introduction ................. |CRIntro|
2. What's Not Included .......... |CRNotIncluded|
3. What's Included .............. |CRIncluded|
4. Known Issues ................. |CRIssues|
5. Future Plans ................. |CRPlans|
==============================================================================
INTRODUCTION *CRIntro*
This is my personal Nvim config. It is a complete rewrite of my old Vim
configuration, and aims to catch up with the five years that have passed since
I first started using Vim.
My previous configuration was almost aggressively minimal - I resisted the
temptation to include and maintain a lot of plugins, and kept the
configuration as straightforward as possible. While that has served me well
at the time, the past few years brought with them a few changes:
- Vim has changed. Nvim seems to reign supreme now, and the rapid developments
there have made a lot of previously slow or unstable features possible and
even natively supported.
- My work has changed. I used to work a lot with Ruby - an incredibly dynamic
language that I have no idea how would anyone ever be able to write an
auto-complete engine for, let alone a whole LSP. Now I work mostly with Go
and Rust, which lend themselves very well to the recent crop of developer
tools.
- My experiences have changed. Having used JetBrains tools and VS Code
extensively for Go and Rust development, there are a lot of great ideas and
features in both tools that I'd like to keep with me.
- Finally, I have changed. There is probably something profound and deep to be
said about this point, and surely I will remember to return and elaborate on
this.
So, with these motivations, I sat down and, over the course of a few days, as
my time allowed, rewrote these configs. They have been tested as I worked on
them, but they are yet to go through the extensive battle-testing that I
intend on putting them through, and there are sure to be adjustments, tweaks
and new discoveries to be made along the way.
Here's to the next five years! 🥂
==============================================================================
WHAT'S NOT INCLUDED *CRNotIncluded*
Knowing what is not the goal of a project is often times as important, if not
more important, than knowing what the goals are. For this particular config,
the "anti-goals" would be:
------------------------------------------------------------------------------
Not A Distro
There are a lot of Nvim "kitchen sink" distributions to be found around:
AstroVim, SpaceVim and LunarVim are probably the most popular ones. Those are
fine. But the effort I'd put into learning and getting used to all the keymaps
and the plugins that get set up for me is probably better spent on just doing
it myself and learning as I go. We all have a limited amount of time on this
planet and in the end I can either learn how to work with and configure
SpaceVim, or I can learn how to work with and configure Nvim.
Likewise, while I would be honored if someone took inspiration from, pieces
of, or even the entierty of my configuration, making it work for anyone other
than me is not my goal.
------------------------------------------------------------------------------
Still Just A Text Editor
You can put a lot of things into Nvim: a task manager, a personal wiki, a
calculator, an email client, an IRC client, an RSS reader, hell someone
probably figured out how to run Doom in this thing. While those are certainly
impressive feats, I still want my text editor to be just a text editor.
------------------------------------------------------------------------------
Enhance, Don't Replace
Vim has a lot of options. Nvim has even more. Plugins can often reinvent
what Nvim already natively supports or even overlap in their implementations.
Where possible, the config should build on top of what is already there,
whether it comes from a plugin or Nvim itself. This is not always feasible,
but we try.
==============================================================================
WHAT'S INCLUDED *CRIncluded*
The minimalist ideas from my previous configurations have been gently put
aside in favor of a more standard list of features that I'd expect from a
modern text editor.
These include:
------------------------------------------------------------------------------
Theme
|catppuccin| comes in 4 flavors and it's a joy in all four.
------------------------------------------------------------------------------
Editing
Basic editing plugins, like |surround|, |commentary|, repeat and |autoclose|.
This makes changing tags, commenting stuff out and not forgetting closing
parentheses easier.
------------------------------------------------------------------------------
User Interface
A visual overview of a project's structure is helpful sometimes, especially
when navigating around a fresh code base. |NvimTree| replaces the venerable
netrw.
<Alt-1> *ALT-1* *M-1*
toggle the sidebar tree, focused on the current file
The |status-line| and the |tabline| have also been augmented with
|lualine.txt| and |tabby.txt|. They should behave like native Vim statusline
and tabs, just slightly nicer.
When you start coding, you will notice that, at the end of every block,
virtual text noting the start of that block appears. I've found this extremely
helpful in other editors when dealing with deeply nested methods. This is
courtesy of |nvim-biscuits|.
Finally, I included |peepsight| as a fun addition that enables syntax
highlighting only in the block you are currently editing.
<Space>tf *<Space>tf*
toggles "focus mode".
------------------------------------------------------------------------------
Search and fuzzy finding
For the past five years, a fuzzy file finder has been the primary way I
navigated any project, and this tradition continues with |telescope.nvim| and
|search.nvim-search-nvim|.
<Cmd-Shift-p> *D-S-p*
<Ctrl-P> *C-p* *CTRL-p*
shows the fuzzy file finder
<Space>sc *<Space>sc*
fuzzy find recent files
<Space>sd *<Space>sd*
fuzzy find LSP diagnostics in buffer
<Space>sg *<Space>sg*
fuzzy find files tracked by Git
<Space>sf *<Space>sf*
fuzzy find all files
<Space>sh *<Space>sh*
fuzzy find help tag
<Space>sr *<Space>sr*
live grep
<Space>so *<Space>so*
search through |nvim-devdocs|
------------------------------------------------------------------------------
Language support
Comprehensive support for editing code is the most important feature of this
config. An LSP setup is included, with automatically installable servers,
completion, auto-formatting that respects folds and the current buffer state,
diagnostics in virtual text, a symbol outline, snuppets, and dedicated plugins
for Rust, Go and JSON/YAML schemas.
If a LSP is available, the following keybinds should work:
<Alt-3> *ALT-3* *M-3*
toggle outline
<Space>cf *<Space>cf*
={motion}
gq{motion}
format code
<Space>cr *<Space>cr*
rename the symbol under the cursor
<Space>ca *<Space>ca*
open a list of available code actions
gd *gd*
find definitions
gr *gr*
find references
gI *gI*
go to implementation
<Space>cd *<Space>cd*
see type definition
<Space>wd *<Space>wd*
search through document symbols
<Space>ws *<Space>ws*
search through workspace symbols
K *K*
pop up LSP documentation
gD *gD*
go to declaration directly
<A-k> *ALT-k*
pop up function signature
<Space>wl *<Space>wl*
list directories in the workspace
<Space>wa *<Space>wa*
add directories to the workspace
<Space>wr *<Space>wr*
remove directories from the workspace
<Ctrl-Return> *CTRL-ENTER*
*CTRL-RETURN*
select the current node (statement,
function, class...). keep pressing to grow
selection further out.
<Alt-Return> *ALT-ENTER*
*ALT-RETURN*
decrease current selection to nearest node
<Ctrl-S> *C-s* *Ctrl-s*
grow current selection to next scope
------------------------------------------------------------------------------
Git
|fugitive| and |gitsigns| are both included. Since most of my Git usage is
done through the command line, I did not include a whole visual Git setup - an
occasional `:Git commit` is more than enough for me. But, while editing, it's
useful to know what has changed, and it's even more useful to use Git as a
"big undo" button. The following keybinds should work in Git repos:
<Space>gh *<Space>gh*
toggle change highlight
<Space>gp *<Space>gp*
show the diff for the hunk inline
<Space>gb *<Space>gb*
blame current line
<Space>gr *<Space>gr*
reset (undo) hunk
------------------------------------------------------------------------------
Debugging
For me, a debugger and a task runner have always been two of the most wonky
tools to set up, and I've probably spent just as much time debugging my
debugging setup as I have saved from actually using a debugger. However, a
debugger is an incredibly useful piece of kit, and if anything, that should
just make it more important to properly set it up.
|dap.txt| and |nvim-dap-ui| are both set up to the best of my ability (for
now). They should work in tandem with either a dedicated language plugin, or
|overseer|, which can read either its own task form or the `launch.json` task
format used by VS Code.
There is a lot to be done here to make it truly seamless and pretty. But this
is a start.
In addition, |trouble.nvim.txt| is included as a single location to view
diagnostics, and |todo-comments.nvim.txt| extends this functionality by
reporting on various TODOs in the code.
<Alt-2> *ALT-2* *M-2*
toggle runner (overseer)
<Alt-4> *ALT-4* *M-4*
toggle diagnostics
<Alt-5> *ALT-5* *M-5*
toggle debug UI
<Space>r *<Space>r*
run an Overseer task
<Space>st *<Space>st*
show TODO entries
<Space>eb *<Space>eb*
set breakpoint
<Space>ec *<Space>ec*
continue debug
<Space>ee *<Space>ee*
evaluate
<Space>eo *<Space>eo*
open debug UI
<Space>es *<Space>es*
step into
<Space>et *<Space>et*
step over
<Space>ex *<Space>ex*
close debug UI
------------------------------------------------------------------------------
Documentation
All binds should be at least mentioned in |which-key.nvim.txt| - hitting
<Space> and waiting for a little bit should pop up a small cheat-sheet.
<Space>so *<Space>so*
browse devdocs.io
------------------------------------------------------------------------------
Fun
A few "silly" plugins are included, because despite the editor being just an
editor, there is value in being a bit silly sometimes. These plugins might get
rotated out at some point if I do not feel like they are bringing me joy.
A simple dashboard is included. I don't expect to see it often as launching
nvim with `nvim .` is in my muscle memory now, but it looks nice and pops up a
random `fortune` quote.
usage-tracker is set up to track 2 weeks worth of usage info. I like my stats,
and I might want to display them somewhere at some point -- maybe the
dashboard! -- so I'll keep it for now.
|venn| is a diagramming tool. I have no idea why I'd use it over `mermaid` or
a similar tool that actually renders out images/SVGs, but I want to give it a
shot regardless.
==============================================================================
KNOWN ISSUES *CRIssues*
- Formatting is a bit goofy in buffers without an LSP attached (I'd at least
want word-wrap)
- Autoclose doubles up single quotes when writing text - might want to disable
it for single quotes unless it's next to a paren or a brace.
- LSP motions do not get assigned.
==============================================================================
FUTURE PLANS *CRPlans*
- Sniprun is included, but its usefulness is minimal until I find a way to
quickly create "playground" / "scratch" windows (the nvim-scratch plugin was
not that helpful as it did not attach an LSP)
- Debug setup is going to need some more love.
- I would love to have a better git merge setup.
- I want to bring back the automatic dark/light theme switch.
- `mason` should set up all necessary tools, not just the LSPs.
==============================================================================
vim:tw=78:ts=8:ft=help:norl: