Vim Cheatsheet and Reference Card
Vim Cheatsheet and Reference Card
Vim Cheatsheet and Reference Card
Vim is a very efficient text editor. This reference was made for Vim 8.0.
For shortcut notation, see :help key-notation.
Getting started
Exiting
Shortcut Description
:q Close file
:w Save
Navigating
Shortcut Description
1/11
Shortcut Description
Words
Shortcut Description
Line
Shortcut Description
$ End of line
Character
fc Go forward to character c
Fc Go backward to character c
Document
Shortcut Description
gg First line
G Last line
Window
Shortcut Description
2/11
Shortcut Description
zz Center this line
Search
Shortcut Description
N Previous match
Tab pages
Shortcut Description
:tabedit [file] Edit file in a new tab
Editing
Shortcut Description
a Append
3/11
Shortcut Description
i Insert
o Next line
O Previous line
u Undo changes
Shortcut Description
Clipboard
Shortcut Description
x Delete character
p Paste
P Paste before
Visual mode
4/11
Shortcut Description
v Enter visual mode
In visual mode
Shortcut Description
s Replace selection
Shortcut Description
Operators
Usage
Operators let you operate in a range of text (defined by motion). These are performed in
normal mode.
d w
Operator Motion
Operators list
Shortcut Description
d Delete
y Yank (copy)
5/11
Shortcut Description
= Autoindent
g~ Swap case
gU Uppercase
gu Lowercase
Examples
Shortcut Description
Text objects
Usage
Text objects let you operate (with an operator) in or around text blocks (objects).
v i p
Text objects
Shortcut Description
p Paragraph
6/11
Shortcut Description
w Word
s Sentence
b A block [(
B A block in [{
Examples
Shortcut Description
Diff
Shortcut Description
Misc
Folds
Shortcut Description
zo / zO Open
zc / zC Close
7/11
Shortcut Description
za / zA Toggle
zM Close all
zR Open all
zx Update folds
Navigation
Shortcut Description
% Nearest/matching {[()]}
]) Next
Jumping
Shortcut Description
<C-I> Go forward
gf Go to file in cursor
Counters
Shortcut Description
<C-X> Decrement
Windows
8/11
z{height}<Cr> Resize pane to {height} lines tall
Tags
Shortcut Description
Case
Shortcut Description
gU Uppercase
gu Lowercase
Marks
Shortcut Description
9/11
Shortcut Description
Misc
Shortcut Description
Command line
Shortcut Description
Text alignment
10/11
:center [width]
:right [width]
:left
Calculator
Shortcut Description
<C-R>=128/2 Shows the result of the division : ‘64’
:cq
:cquit
Works like :qa, but throws an error. Great for aborting Git commands.
Spell checking
Shortcut Description
zu / C-X (Insert Mode) Suggest words for bad word under cursor from
spellfile
11/11