Neovim Cheatsheet

Complete nvim command reference — searchable, fast, always free

🔍 / to search

Click any command for a description & example

N Normal I Insert V Visual C Command
Modes
iInsert before cursor
IInsert at line start
aInsert after cursor
AInsert at line end
oNew line below, insert
ONew line above, insert
vVisual (character)
VVisual (line)
Ctrl+vVisual (block)
:Command mode
Esc / Ctrl+[Return to Normal
RReplace mode
Navigation — Basic
h j k l← ↓ ↑ →
w / WNext word / WORD
b / BPrev word / WORD
e / EEnd of word / WORD
0 / ^Line start / first non-blank
$Line end
gg / GFile start / file end
:NGo to line N
%Jump to matching bracket
{ / }Prev / next blank line (paragraph)
Ctrl+d / Ctrl+uHalf-page down / up
Ctrl+f / Ctrl+bFull-page down / up
Editing
xDelete character
ddDelete line
dwDelete word
d$ / DDelete to end of line
yyYank (copy) line
YYank to end of line (= y$)
ywYank word
p / PPaste after / before cursor
uUndo
Ctrl+rRedo
cc / CChange line / to end of line
cwChange word
r{char}Replace single character
~Toggle case
JJoin line below to current
.Repeat last change
Text Objects (combine with d/c/y/v)
iw / awInner / around word
is / asInner / around sentence
ip / apInner / around paragraph
i" / a"Inner / around double quotes
i' / a'Inner / around single quotes
i` / a`Inner / around backticks
i( / a(Inner / around parens
i[ / a[Inner / around brackets
i{ / a{Inner / around braces
it / atInner / around HTML tag
Search & Replace
/patternSearch forward
?patternSearch backward
n / NNext / prev match
*Search word under cursor (fwd)
#Search word under cursor (bwd)
:s/old/new/Replace first on line
:s/old/new/gReplace all on line
:%s/old/new/gReplace all in file
:%s/old/new/gcReplace with confirmation
:nohClear search highlight
Splits & Windows
:sp / :vspHorizontal / vertical split
Ctrl+w sHorizontal split
Ctrl+w vVertical split
Ctrl+w h/j/k/lMove between splits
Ctrl+w H/J/K/LMove split to edge
Ctrl+w =Equalize split sizes
Ctrl+w _ / |Max height / max width
Ctrl+w +/-Increase / decrease height
Ctrl+w qClose split
Ctrl+w oClose all other splits
Tabs
:tabnewOpen new tab
:tabnew {file}Open file in new tab
gt / gTNext / prev tab
:tabn / :tabpNext / prev tab
:tabcloseClose current tab
:tabonlyClose all other tabs
{N}gtGo to tab N
Files & Buffers
:e {file}Edit file
:wSave
:w {file}Save as
:w ++pSave, creating parent dirs if needed
:wq / :xSave and quit
:qQuit
:q!Quit without saving
:wqaSave all and quit
:ls / :buffersList buffers
:bn / :bpNext / prev buffer
:bdDelete (close) buffer
:b {N}Switch to buffer N
Ctrl+^Toggle last two buffers
Marks & Jumps
m{a-z}Set local mark
m{A-Z}Set global mark
'{mark}Jump to mark line
`{mark}Jump to exact mark position
''Jump to last position
Ctrl+o / Ctrl+iJump back / forward in history
:marksList all marks
Macros
q{a-z}Start recording macro into register
qStop recording
@{a-z}Play macro
@@Repeat last macro
{N}@{a-z}Play macro N times
:regView all registers / macros
Visual Mode
v + motionSelect characters
V + motionSelect lines
Ctrl+v + motionBlock select
d / xDelete selection
yYank selection
cChange selection
> / <Indent / un-indent
u / ULowercase / uppercase
:Run command on selection
gvReselect last selection
Folding
zc / zoClose / open fold
zaToggle fold
zC / zOClose / open all folds at cursor
zM / zRClose all / open all folds in file
zf{motion}Create fold
zdDelete fold at cursor
zj / zkMove to next / prev fold
Neovim-Specific
:checkhealthRun health diagnostics
:terminalOpen built-in terminal
Ctrl+\ Ctrl+nExit terminal to Normal mode
:LazyOpen Lazy.nvim plugin manager
:MasonOpen Mason LSP installer
KLSP hover docs
gdGo to definition (LSP)
grrFind references (LSP)
griGo to implementation (LSP)
grnRename symbol (LSP)
graCode action (LSP)
gODocument symbols (LSP)
Ctrl+S (Insert)Signature help (LSP)
]d / [dNext / prev diagnostic
Useful Commands
:set numberShow line numbers
:set relativenumberRelative line numbers
:set wrap / nowrapToggle line wrap
:set ignorecaseCase-insensitive search
:set spellEnable spell check
:sortSort selected lines
:!{cmd}Run shell command
:r !{cmd}Insert shell output at cursor
:verbose map {key}Show where a key is mapped
Ctrl+gShow file info + cursor position
gaShow ASCII/Unicode of character
✎ Custom bindings: