This is a mainly python-focused config, with a slightly different version in the remote branch, meant for remote systems (such as ancient slurm servers) with no sudo access
Here’s a rundown of the main plugins I use in this config and what role each plays in my workflow:
-
snacks - Indentation guides, bigfile support, zenmode, my picker of choice and much more
-
blink.cmp – I've added Copilot as a source here, instead of
ghostin-line suggestions -
nvim-autopairs – Autocompletes an assortment of parantheses
-
barbar.nvim - The status bar (bottom)
-
conform.nvim – For code formatting
-
flash.nvim – Makes moving around text way faster.
-
img-clip.nvim – I often need to drop screenshots or figures into Markdown/notes. This plugin lets me just paste from the clipboard and it handles saving and linking the image. Zero friction.
-
nvim-ufo Folding code
-
oil.nvim – Files as a buffer
-
persistence.nvim – Session management
-
trouble.nvim – Organized reasons why your code might suck
-
yanky.nvim - Better yanking and yeeting
-
#NOTE: Some extra stuff like debugging support can be found in the
lua/plugins/archivedirectory (not enabled by default)
- Actually learn to use neovim
- Set up Which-Key properly
- DAP: Set up and learn debugging
- Option to open config dir on homepage
- Set up folding (maybe nvim-ufo?)
- Set up flash.nvim
- Learn macros, learn how to use
treesitter-textobjects
-
A buffer: The in-memory representation of a file | A buffer is contained in a window | IF you open the same buffer in different window both buffers are the same representation |
-
Press
F1to open help -
LEARN macros: Store, record and replay actions
-
Left:
h| Rightl| Up:k| Down:j -
Skip word forward:
w| skip word backward:b| Skip contiguous text (till whitespace):Wforward |Bbackward -
_or0: goes to the beginning |$: goes to the end -
Case: Say you want to go up 6 lines: Press
6-k(Hint: press<leader>-tnto toggle relative line numbers -
Insert Mode: Pressing
ioraboth go into insert mode,i: Enter before cursor |a:Enter after cursor -
Visual Line Mode:
Shift-v: Select a line at a time -
To find file path and current line number:
<C-g>
-
Delete: Press
ddto delete current line | Pressuto undo -
Delete: Works with counts and navigation keys (Case:
d-3-jwill delete 3 lines down, andd-wwill delete the current word if you are on the first letter of the word) Visual Mode:v| Yank:y| Paste:p| -
Cut and Paste: Weird behaviour: If you delete a line using
d, it goes into the same buffer as the yank (y) buffer, and if you presspafter deleting a line it pastes that line you deleted (basically cut and paste)... -
NOTE: This means if you paste a line over another line, the line that was removed will now be pasted the next time you call
p.. -
NOTE: counts work with yank too! So to copy the 5 lines above this, we do
y-5-kand voila! -
<C-g>: Shows full path and location in file -
To manually indent text:
>-4-jwill indent 4 lines below
-
NOTE: Can combine these: e.g.
d-$will delete everything from your cursor to the end of the line -
Jump forward to specific character(cursor before) in line:
f-char| cursor after:t-char| to repeat:;fwd,back -
If your cursor is ahead of something and you want to go back"
F-char -
With Motions: e.g.: This is a line ... With cursor after this line,
d-F-Twill delete everything till the T in "This" -
Igoes to beginning of line in INSERT mode |Agoes to the end of the line in insert mode -
o:Make new line, go into INSERT mode |O:Make new line above cursor, go into INSERT mode
-
To go to a specific line in your file:
<line>-ggor<line>-G -
Go to start of file:
gg| End of file:G -
Go down half a page and center current line:
<C-d>| Go Up:<C-u>
-
Just type
/and type target word |nto next |Nto previous | -
Reverse search: Just type
? -
*: If you are on a word and want to search its instances -
%: To search for matching parentheses ({/}or[/]or(/)(Press once to highlight the partner, and twice to go to the partner) -
The
:scommand: Substitutes stuff | e.g.:s/old/newsubstitutes old string for new -
:s/old/new/g: Substitutes all occurences in current line (g: global) | -
:%s/old/new/g: Substitutes all occurences globally | usegcinstead ofg: Asks for confirmation every time
-
To select everything between two parentheses:
v-i-(orv-i-)| NOTE: Same works for{}/[]etc. -
To include the parentheses as well:
v-a-(orv-a-) -
Similarly, to yank everything: just replace
vwithy: e.g.:y-a-(will yank everything in a(xyz)including the parentheses -
To open a file whose path is under the cursor:
g-f| To open a link:g-x -
v-i-b: Select inside of()|v-i-B: Select inside of{}| To include the brackets: useainstead ofi -
i: Inside |a: all |b: braces |c: change
- I'm only listing the basic ones I think are super cool
fis the function object picker | Sov-i-fwill change in the function |c-a-fwill change around the functioncis the class object picker | Sov-i-fwill select stuff inside the class- To scroll by functions: Press
]-mto go forward and[-mto go backward - To go to end of functions (the above one goes to the start: Replace
mwithM - For classes, replace
mwith]andMwith [
- To add a TODO or a HACK, use the comment+ + label (e.g.: -- HACK)
- Vim-Surround:
ys: Indicates yank-s (as justswould mean substitute) - Vim-Surround: So
ys<motion><delimiter>would be the way - Vim-Surround:
cs<target><new>will change delimiter surrounding cursor - Vim-Surround: In Visual mode, to surround a selection type
S<delimiter>