Neovim Cheat Sheet

Basics

Command
Mode
Description
:help
ex
Open a help window
:write
ex
Write to a file
:wq
ex
Write to a file and quit window or vim
:quit
ex
Quit current window (when one window quit vim)
For More Information check out: Neovim Fundamentals

Buffers

Command
Mode
Description
:bnext
ex
Go to next buffer in the buffer list
:bprevious
ex
Go to previous buffer in the buffer list
:bdelete
ex
Remove a buffer from the buffer list
:ls
ex
List all buffers
For More Information check out: Mastering Neovim Buffers

Changes

Command
Mode
Description
:changes
ex
Print the change list
[n] g,
n
Go to n newer position in change list
[n] g;
n
Go to n older position in change list
For More Information check out: Working with Neovim's Change List

Cursor Horizontal

Command
Mode
Description
[n] h
n
Cursor n chars to the left
[n] l
n
Cursor n chars to the right
[n] w
n
Cursor n words forward
[n] W
n
Cursor n words forward
[n] e
n
Cursor forward to the end of word n
[n] E
n
Cursor forward to the end of word n
[n] b
n
Cursor n words backward
[n] B
n
Cursor n words backward
0
n
Cursor to the first char of the line
^
n
Cursor to the first char of the line
[n] $
n
Cursor to the end of nth next line
g_
n
Cursor to the last char n - 1 lines lower
For More Information check out: Navigating Horizontally

Cursor Vertical

Command
Mode
Description
[n] j
n
Cursor n lines downward
[n] k
n
Cursor n lines upward
[n] H
n
Cursor to line n from top of screen
M
n
Cursor to middle line of screen
[n] L
n
Cursor to line n from bottom of screen
[n] gg
n
Cursor to line n, default first line
[n] G
n
Cursor to line n, default last line
For More Information check out: Navigating Vertically

Cut And Paste

Command
Mode
Description
[n] ["x] yy
n
Yank the current line
yiw
n
Yank inner word
y$
n
Yank to end of current line
[n] ["x] Y
n
Yank to end of current line
[n] ["x] p
n
Put the text [from register x] after the cursor n times
[n] ["x] P
n
Paste before the cursor
[n] ["x] dd
n
Delete the current line
diw
n
Delete inner word
[n] ["x] d$
n
Delete from the cursor to the end of the line (and the next n-1 lines)
[n] ["x] D
n
Delete from the cursor to the end of the line (and the next n-1 lines)
[n] ["x] x
n
Delete n characters under and after the cursor [into register x]
For More Information check out: Neovim Editing Basics

Editing

Command
Mode
Description
[n] r{char}
n
Replace n chars with {char}
R
n
Enter replace mode: overtype existing characters, repeat the entered text n-1 times
J
n
Join n lines; default is 2
gJ
n
Join lines without inserting space
gwip
n
Reflow the current paragraph
u
n
Undo changes
For More Information check out: Mastering Editing with Neovim

Folds

Command
Mode
Description
za
n
Open a closed fold, close an open fold
zm
n
Increase folding by one level (more folding)
zo
n
Open fold
zO
n
Open folds recursively
zc
n
Close a fold
zC
n
Close folds recursively
zr
n
Decrease folding by one level (reduce folding)
zR
n
Open (remove) all folds
For More Information check out: Mastering Neovim Folds

Insert Mode

Command
Mode
Description
[n] i
n
Insert text before the cursor n times
[n] I
n
Insert text before the first char on the line n times
[n] a
n
Append text after the cursor n times
[n] A
n
Append text after the end of the line n times
[n] o
n
Begin a new line below the cursor and insert text, repeat n times
[n] O
n
Begin a new line above the cursor and insert text, repeat n times
[n] ["x] cc
n
Delete the current line then enter insert mode
[n] ["x] C
n
Change from the cursor position to the end of the line, and n-1 more lines [into register x]; synonym for "c$"
c$
n
Delete from the cursor position to the end of the line, and enter insert mode
cw
n
Delete from the cursor position to the end of the current word, and enter insert mode
ce
n
Delete from the cursor position to the end of the current word, and enter insert mode
ciw
n
Delete the current inner-word, and enter insert mode
[n] ["x] s
n
(substitute) delete n characters [into register x] and start insert
[n] ["x] S
n
Delete n lines [into register x] and start insert; synonym for "cc".
For More Information check out: Insert Mode

Jumps

Command
Mode
Description
:jumps
ex
Print the jump list
C-I
n
Same as <tab>
C-O
n
Jump one step backward within jump list
``
n
Cursor to the position before latest jump
`"
n
Go the position of the most recent edit prior to saving this file
For More Information check out: Working with the Jump List

Macros

Command
Mode
Description
q{0-9a-zA-Z"}
n
Record typed characters into named register {0-9a-za-z"} (uppercase to append)
q
n
(while recording) stops recording
[n] @{a-z}
n
Execute the contents of register {a-z} n times
[n] @@
n
Repeat the previously-executed macro n times
For More Information check out: Mastering Neovim Macros

Marks

Command
Mode
Description
:marks
ex
List all marks
`x
n
Jump to mark x
'x
n
Jump to the start of the line containing mark x
For More Information check out: Mastering Neovim Marks

Paging

Command
Mode
Description
C-D
n
Move cursor down one-half page
C-U
n
Move cursor up one-half page
C-B
n
Move screen up one page
C-F
n
Move screen down one page
For More Information check out: Navigating Vertically by Page

Registers

Command
Mode
Description
:registers
ex
Display the contents of registers
["x] y
n
Yank operator
["x] p
n
Put the text [from register x] after the cursor n times
For More Information check out: Mastering Neovim's Registers

Visual Mode

Command
Mode
Description
o
v
Move cursor to other corner of area
O
v
Move horizontally to other corner of area
Esc
v
Return to normal mode
aw
v
Extend highlighted area with "a word"
ab
v
Extend highlighted area with a () block
aB
v
Extend highlighted area with a {} block
at
v
Extend highlighted area with a tag block
ib
v
Extend highlighted area with inner () block
iB
v
Extend highlighted area with inner {} block
it
v
Extend highlighted area with inner tag block
For More Information check out: Visual Mode

Windows

Command
Mode
Description
[n] C-W s
n
Split current window in two parts, new window n lines high
[n] C-W v
n
Split current window vertically, new window n columns wide
[n] C-W h
n
Go to nth left window (stop at first window)
[n] C-W j
n
Go n windows down (stop at last window)
[n] C-W k
n
Go n windows up (stop at first window)
[n] C-W l
n
Go to nth right window (stop at last window)
[n] C-W x
n
Exchange current window with window n (default: next window)
For More Information check out: Mastering Neovim Windows