Cheatography
https://cheatography.com
My personalized neovim keymaps
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Move Horizontally
Normal Mode |
h/l |
Left Right |
f/F/t/T |
Move to a char |
\ |
Repeat Forward |
, |
Repeat Backward |
w/W/e/E |
Move to start/end Word |
b/B |
Move back to start of word |
0/$ |
Start/End of Line |
^/Backspace |
Start character of Line |
<S-Left/Right> |
Left/Right while selecting |
Insert Mode |
<C-f> |
Move start of indent |
zH |
Scroll to leftest char |
Move Vertically
Normal Mode |
j / k |
Down/Up |
<C-d>/<C-f> |
Down/Up 10 lines |
} / { |
Next/Prev Paragraph |
gg / G |
Top/Bottom of file |
<S-Up/Down> |
Up/Down while selecting |
gj / gk |
Down/Up display line |
zz |
Center Current Line |
<C-e> / <C-y> |
Scroll Up/Down |
zt / zb |
Scroll Line to Top/Bottom |
Editing
Enter Insert Mode |
a / i |
Append / Insert |
gi |
Insert at the end of last insert |
A / I |
Line version a/i |
o / O |
Below/Above New Line |
c / C / d / D |
Change/Delete Movement/Line |
Editing |
J |
Join line below to current |
<leader>*({"'< |
Surround the visual selection |
. |
Repeat last edit |
x |
Delete a character |
u / <C-r> |
Undo/Redo |
p / P |
Paste After/Before |
gp / gP |
Paste and move to end |
In The Insert Mode |
<C-hjkl> |
Move Like Arrows |
<C-f> |
Move To Current Indent |
<C-w> |
Delete prev word |
<C-o> |
Temporary normal mode |
<C-r><register> |
Paste Register |
<C-r>= |
Evaluate expression then paste |
Jumping
% |
Matching Parens |
<C-o> / <C-i> |
Prev/Next Jump |
/ ? |
Search to Jump |
<leader>s |
Leap |
:number |
Jump to line |
'<mark> |
Jump to mark (start of line) |
`<mark> |
Jump to mark |
Code Completion and Templates
<C-Space> |
Cmp Menu Toggle (insert mode) |
<C-e> |
Expand Snippet (insert mode) |
<C-n> / <C-p> / Down / Up |
Next/Prev Cmp item |
<C-y> / Enter |
Accept |
|
|
Find And Replace
/ |
Search |
? |
Search Backward |
n/N |
Next/Prev Occurance |
<leader><space> |
Toggle Highlighting |
<leader>r |
Search word under cursor |
<leader>R |
Replace word under cursor |
:vim Pattern Files |
Search In Files. Supports patterns |
:grep String Files |
Search using grep (rg) |
:Rg String [Files] |
Use Rg extension to search |
<leader>pg |
Telescope Grep |
:GrugFar |
Vscode Like Search |
r<char> |
Replace character |
<C-a> |
Increment Number |
<C-x> |
Decrement Number |
Find And Replace In Project |
:Rg search |
:cdo s/prev/next/gc |
Text Objects
w |
Word |
[ { ' " ( < |
s |
Sentence |
p |
Paragraph |
<C-Space> |
Expand Selection (with lsp objects) |
<C-s> |
Shrink Selection |
t |
HTML Tag |
f |
Function |
b |
Block |
c |
Class |
a |
Argument |
Lsp Actions
K |
Trigger Hower |
gd |
Go definition |
gcd |
Go declaration |
gI |
Go implementation |
go |
Go type definition |
gs |
Signature Help |
<F2> |
Lsp Rename |
gca |
Code Actions |
gl |
Open error float |
gR |
Glance References |
]d / [d |
Next/Prev Error |
]D / [D |
Next/Prev Diagnostic |
gS / <C-s> |
Signature Help n/i mode (extension) |
Marks
[a-z] |
Local marks |
[A-Z] |
Global marks |
. |
Last Change |
' |
Last Jump |
[ / ] |
Start/End last pasted text |
< / > |
Start/End last visual selection |
[0-9] |
Jumplist Locations |
Actions |
'<mark> |
Jump to mark (start of line) |
`<mark> |
Jump to mark |
Registers
System Registers |
" |
Last Delete/Change/Yank |
0 |
Last Yank |
* / + |
System Clipboard |
: |
Last executed command |
. |
Last inserted text |
% |
Current file ame |
/ |
Last search pattern |
_ |
Black hole |
Register Actions |
<C-r><register> |
Insert register (insert mode) |
:let @a = "something" |
Put something into a register |
:let @a = @+ |
Put the clipboard content into a |
<C-r>= |
Put expression result |
|
|
Tabs
<leader>tn |
New Tab |
<leader>ta |
New Tab |
<leader>tc |
Close Tab |
<leader>tm<left> |
Move Tab Left |
<leader>tm<right> |
Move Tab Right |
<leader>t<left> |
Go Left Tab |
<leader>t<right> |
Go right Tab |
<leader>tt |
New Terminal Tab |
:TabRename name |
Rename tab |
Buffers
<leader>ba |
Vertical Split |
<leader>bA |
Horizontal Split |
<leader>bp |
Telescope Buffers |
<leader>bn |
New Empty Buffer |
<leader>bc |
Close Buffer |
<leader>b<arrow> |
Move Panel |
Browse and Telescope
; |
Files |
<leader>pg |
Grep |
<leader>pr |
Resume |
<leader>pb |
Buffers |
<leader>pd |
Diagnostics |
<leader>pc |
Git status |
<leader>pm |
Marks |
<leader>pq |
Quickfix |
<leader>ps |
Workspace Symbols |
<leader>p? |
Keymaps |
<leader>ph |
Highlights |
<leader>u |
Undo Tree |
<leader>pe |
Yazi |
<leader>pE |
Resume Yazi |
- |
Oil |
Quick Fix List
<leader>co |
Open QFList |
<leader>cc |
Close QFList |
]q / [q |
Next/Prev Item |
<leader>cn / cp |
Next/Prev Item |
<leader>a |
Add to QFList |
dd on QFList |
Remove Item |
:w name.qf |
Write QFList to file |
:cfile name.qf |
Load to the QFList |
:cdo command |
Do command on QFList |
:make, :vim, :Rg |
Populate QFList |
Code Actions
<leader>vb |
pnpm run build |
<leader>vi |
pnpm install |
Git
<leader>hw |
Neogit |
<leader>hc |
Diffview close |
<leader>hv |
Diffview File History |
] / [ |
Next/Prev Hunk |
Save
s |
Save |
<leader>S |
SaveAll and exit |
:SaveAll |
Save all that can be saved |
:DeleteBackgroundBuffers |
nvims |
Start neovim from save |
Misc
<leader>td |
Todo Menu |
<leader>f |
Format File |
<leader>u |
Undo Tree Toggle |
<leader>hd |
Toggle Diagnostics |
<leader>hf |
Toggle Formatting |
:ColorizerAttachToBuffer |
:make |
gf |
Open file (in neovim) |
gx |
Open file (in system) |
|