Neovim Cheatsheet

https://neovim.io/

General & Desktop

C-sIV
Save buffer (:w)
C-aV
Select all (ggVG)
C-z
Undo
C-r
Redo
C-lV
Select whole line (V)
A-C-dIV
Duplicate line
Esc Esc
Clear search highlight (:noh)
F1
Help (:h)
F3
Toggle search highlighting
F4
Quit window (:q)
F6
Toggle word wrap
F7I
Insert ISO datetime
F10
Edit init.lua config
F11
Show active keymaps (Snacks)

Navigation & Motions

HomeIV
Smart Home (first non-blank / 0)
EndIV
Smart End ($ / past last char)
WV
Next subword start (Spider)
BV
Prev subword start (Spider)
EV
Next subword end (Spider)
g EV
Prev subword end (Spider)
A-C-RightIV
Spider subword forward
A-C-LeftIV
Spider subword backward
%
Matching pair ((), {}, [])
] u[ u
Next / prev URL
g x
Open URL or file under cursor

Hop & Text Objects

s␣ w V
Hop Word
SV
Hop Line Start
g sV
Hop 2 characters
␣ j␣ k
Hop Vertical
i SV
Inner subword object
a SV
Outer subword object
i ma m V
Treesitter function inner / outer
i ca c V
Treesitter class inner / outer
a sV
Treesitter local scope object
g aV
EasyAlign text

Line & Black-Hole Editing

A-UpA-Down
Move line up / down
A-kA-j
Insert blank line above / below
F8F9
Insert newline above / below
DelV
Delete char (no clipboard "_x)
BS
Delete char back (no clip "_X)
C-DelC-S-k V
Delete line (no clip "_dd)
A-BSI
Delete word backward (no clip)
A-DelI
Delete word forward (no clip)
A-S-BSI
Delete subword back (Spider)
A-S-DelI
Delete subword forward (Spider)
c W
Change to end of subword
TabS-Tab V
Indent / unindent (retains selection)

Clipboard & Native Marks

C-A-cV
Copy (y)
C-A-xV
Cut (d)
C-A-vIV
Paste (system clipboard)
m a` a
Set / jump buffer mark
m A` A
Set / jump global mark (across files)
` '
Jump before last jump
` .
Jump to last edit
` ^
Jump to last exited insert mode
` [` ]
Jump to start / end of last yank

Multiple Cursors & Surround

C-n
Select word / next occurrence
\ A
Select all occurrences (VM)
C-S-DownC-S-Up
Goto next / prev occurrence
C-LeftMouse
Add cursor at mouse
C-RightMouse
Add cursor on word at mouse
A-C-RightMouse
Add column mouse selection
y s <motion>
Add surround (e.g. ysiw")
c s <old> <new>
Change surround (e.g. cs"')
d s <char>
Delete surround (e.g. ds()
S <char>V
Surround visual selection

LSP & Formatting

K
Hover documentation
g d
Go to definition
g r r
Find references (Quickfix)
g r i
Find implementations
g O
Document outline
F2
Rename symbol
␣ c aV
Code action
␣ fA-S-f V
Smart Format / Rewrap prose
g q
Format paragraph / selection
] d[ d
Next / prev diagnostic
C-SpaceI
Trigger autocomplete (Nvim-Cmp)

Jumplist, Quickfix & History

C-oC-i
Jump older / newer (Jumplist)
g ;g ,
Jump older / newer (Changelist)
␣ q
Toggle Quickfix list
] q[ q
Next / prev Quickfix entry
:Rg <query>
Ripgrep to Quickfix
:cdo s/a/b/ge | update
Batch replace across Quickfix
[ m] m
Prev / next method start
[ {] }
Prev / next enclosing { }
*#
Search word forward / backward
␣ /V
Search selected text

Snacks Picker & Search

C-p\ e
Find Files
C-A-f\ f
Live Grep in files
\ bF5
Find Buffers
\ p
Find Projects
\ r
Recent Files
\ l
Find Lines in buffer
\ j
Find Jumps
\ c
Select Colorschemes
␣ ?
Buffer-local keymaps (Which-Key)

Explorer & OS Tools

` nC-A-e
Toggle Explorer (Snacks)
` f
Find current file in Explorer
A-S-rIV
Reveal file in OS manager
` l␣ g g
LazyGit popup
␣ g s
Git Status picker
␣ `C-F12
Toggle Terminal
␣ c d
Set current file directory (lcd)

Buffers & Splits

C-tF12
New empty buffer (:enew)
A-LeftA-Right
Previous / next buffer tab
C-S-PgUpC-S-PgDn
Move buffer tab left / right
C-F4␣ x
Close buffer (Snacks.bufdelete)
C-^
Toggle alternate (last) buffer
` -
New horizontal split (:new)
` \
New vertical split (:vnew)
C-w -
Rotate split to horizontal
C-w |C-w \
Rotate split to vertical