This is a draft cheat sheet. It is a work in progress and is not finished yet.
Learning
, |
leader |
,p (_dP) |
Paste, keep in buffer |
,s |
Quick Save |
:%s/old/new/g |
Find and replace (gc for confirmation) |
Treesitter
Alt-t |
Open/close |
,f |
Refresh |
,n |
Search File |
Window
:split |
Split window horizontally |
:vsplit |
Split window vertically |
:vnew |
New, empty file, vertical split |
CTRL-W left/right/up/down |
Move to the left/right/up/down |
:qall |
Close all windows |
:wall |
Write all windows (with changes) |
|
|
Tabs (tabpage)
:tabnew |
Open file in new tab |
gt, C-PageUp |
Next Tab |
gP, C-PGDown |
Previous Tab |
Editing
gcc |
Comment line |
gbc |
Comment block |
gco/O/A |
Comment above/below/end of line |
>> |
Increase indent |
<< |
Decrease indent |
]p> |
Paste and keep aligned |
>i} |
Increase block indent |
<i} |
Decrease block indent |
multi-cursor
ctrl-[up,down] |
add cursor up/down |
register
View all registers |
:reg |
View specific register |
:reg <register> |
Ctrl + R, Ctrl + R, <register> |
Insert content of register |
:let @<register>='<register content>' |
Edit register directly |
|
|
NeoVIM configuration
,c (:so %<CR>) |
Reload config |
Scrolling
CTRL-E |
Scroll window Down |
CTRL-Y |
Scroll window Up |
zz |
Center line in window |
macro
q<register> |
start recording to register <register> |
q |
stop recording |
@<register> |
Execute macro |
@@ |
Execute macro again |
|