Vim Cheatsheet
Looking for a Vi/Vim commands cheat sheet with all the basic and easy shortcuts for your vim editor - we have got you covered!
Navigation & Cursor Movement
Standard
h
j
k
l
: Arrow keysw
: Go to the next wordb
: Go to the previous worde
: Go to the next word at the end of the wordge
: Go to the previous word at the end of the word0
: Go to the start of the line$
: Go to the end of the line
Search
n
: Go to the next matching search patternN
: Go to the previous match*
: Next whole word that is under the cursor#
: The previous word that is under the cursor
Searching for Characters
f [char]
: Move forwards to the character supplied within the bracesF [char]
: Move backward to the character supplied within the bracest [char]
: Move forward to just before the characterT [char]
: Move backward to just before the given character
Editing Text
i
: Start insert mode to append at the cursora
: Append after cursorA
: Append from the end of the lineI
: Append from the beginning of the lineo
: Add a blank line below the current line / next lineO
: Add a blank line above the current line / previous lineEsc
orCtrl+[
: Exit insert moded
: Deletedd
: Delete lines
: Delete character and insertS
: Delete line and insertc
: Delete, then open insert modecc
: Delete line, then open insert moder
: Replace one characterR
: Open replace modeu
: Undo changes[number]Ctrl+r
: To redo multiple undos with a single command, you can use this syntax. Here[number]
should be replaced by the actual number of redoes you want to perform, then press and holdCtrl
and typer
.dd
: Delete or cut a linex
: Delete or cut the current characterX
- Delete or cut the previous character
Related: How to select all in Vim
How To ‘Select All’ in Vim
In this guide, we cover the main methods with which you can select all in the vim/vi editor.

Copying and Pasting to Clipboard
yy
: Yank or copy a linep
: Paste after the cursor positionP
: Paste before the cursor positiond
/c
: Copy the deleted text
Saving and Exiting
:w
: Save the file without quitting:wq
: Save and quit:q
: Quit (this command fails if anything in the document has changed without saving):q!
: Quit and throw away changes all unsaved changes:qa
: Close all files:qa!
: Close all files without saving
Shortcuts and Commands for Working with Multiple Files
Ctrl + ws
: split windowCtrl + wv
: split window verticallyCtrl + ww
: switch windowsCtrl + wq
: quit a windowCtrl + wx
: exchange current window with next oneCtrl + w=
: make all windows equal height & widthCtrl + wJ
: make current window full width and positions it at the bottomCtrl + wK
: Makes the current window full width and positions it at topCtrl + wh
: In a vertical split, move cursor to the window on the leftCtrl + wl
: In a vertical split, move cursor to the window on the rightCtrl + wj
: In a horizontal split, move cursor to the window belowCtrl + wk
: In a horizontal split, move cursor to the window aboveCtrl + wH
: Makes the current window full height and positions it at the far leftCtrl + wL
: Makes the current window full height and positions it at the far right