Skip to content

↑↓ moveEnter openEsc close

Vim keyboard shortcuts

Vim 9.1 · 73 shortcuts · checked Nov 2026 · Source: Bram Moolenaar and the Vim community docs

Vim is the modal text editor found on almost every Unix system. Most commands are plain keys typed in Normal mode: these move, edit, search, save and split windows.

Most used Vim keyboard shortcuts

The Vim shortcuts worth learning first. The full list follows, grouped by task.

73 shortcuts

Small screen: your system's keys only. Pick another system in the tabs above.

Modes

11 shortcuts
ActionMacWindowsLinux
Insert before the cursorNormal modeIII
Append after the cursorNormal modeAAA
Insert at the start of the lineNormal modeShiftIShiftIShiftI
Append at the end of the lineNormal modeShiftAShiftAShiftA
Open a new line below and insertNormal modeOOO
Open a new line above and insertNormal modeShiftOShiftOShiftO
Return to Normal modeInsert or Visual modeEscorCtrl[EscorCtrl[EscorCtrl[
Start Visual mode (select characters)Normal modeVVV
Start Visual Line mode (select lines)Normal modeShiftVShiftVShiftV
Start Visual Block mode (select a column)Normal modeCtrlVCtrlVCtrlV
Start Replace mode (overtype)Normal modeShiftRShiftRShiftR

Moving

25 shortcuts
ActionMacWindowsLinux
Move leftNormal modeHHH
Move downNormal modeJJJ
Move upNormal modeKKK
Move rightNormal modeLLL
Jump to the start of the next wordNormal modeWWW
Jump back to the start of the wordNormal modeBBB
Jump to the end of the wordNormal modeEEE
Go to the start of the lineNormal mode000
Go to the first non-blank characterNormal modeShift6Shift6Shift6
Go to the end of the lineNormal modeShift4Shift4Shift4
Go to the first lineNormal modeG,GG,GG,G
Go to the last lineNormal modeShiftGShiftGShiftG
Jump to the matching bracketNormal modeShift5Shift5Shift5
Jump to the next blank lineNormal modeShift]Shift]Shift]
Jump to the previous blank lineNormal modeShift[Shift[Shift[
Cursor to the top of the screenNormal modeShiftHShiftHShiftH
Cursor to the middle of the screenNormal modeShiftMShiftMShiftM
Cursor to the bottom of the screenNormal modeShiftLShiftLShiftL
Scroll a page downNormal modeCtrlFCtrlFCtrlF
Scroll a page upNormal modeCtrlBCtrlBCtrlB
Scroll half a page downNormal modeCtrlDCtrlDCtrlD
Scroll half a page upNormal modeCtrlUCtrlUCtrlU
Center the cursor line on screenNormal modeZ,ZZ,ZZ,Z
Jump back to the previous positionNormal modeCtrlOCtrlOCtrlO
Jump forward againNormal modeCtrlICtrlICtrlI

Editing

22 shortcuts
ActionMacWindowsLinux
UndoNormal modeUUU
RedoNormal modeCtrlRCtrlRCtrlR
Delete the character under the cursorNormal modeXXX
Delete (cut) the lineNormal modeD,DD,DD,D
Delete to the end of the lineNormal modeShiftDShiftDShiftD
Delete to the start of the next wordNormal modeD,WD,WD,W
Change (replace) the wordNormal modeC,WC,WC,W
Change the whole lineNormal modeC,CC,CC,C
Change to the end of the lineNormal modeShiftCShiftCShiftC
Delete the character and insertNormal modeSSS
Copy (yank) the lineNormal modeY,YY,YY,Y
Copy (yank) to the next wordNormal modeY,WY,WY,W
Paste after the cursorNormal modePPP
Paste before the cursorNormal modeShiftPShiftPShiftP
Join the line below to this oneNormal modeShiftJShiftJShiftJ
Repeat the last changeNormal mode...
Indent the lineNormal modeShift.,Shift.Shift.,Shift.Shift.,Shift.
Outdent the lineNormal modeShift,,Shift,Shift,,Shift,Shift,,Shift,
Switch the case of the characterNormal modeShift`Shift`Shift`
Add one to the number under the cursorNormal modeCtrlACtrlACtrlA
Subtract one from the number under the cursorNormal modeCtrlXCtrlXCtrlX
Complete the word from the fileInsert modeCtrlNCtrlNCtrlN
6 shortcuts
ActionMacWindowsLinux
Search forwardNormal mode///
Search backwardNormal modeShift/Shift/Shift/
Next matchNormal modeNNN
Previous matchNormal modeShiftNShiftNShiftN
Search for the word under the cursorNormal modeShift8Shift8Shift8
Search backward for the word under the cursorNormal modeShift3Shift3Shift3
ActionMacWindowsLinux
Save the fileNormal modeShift;,W,EnterShift;,W,EnterShift;,W,Enter
QuitNormal modeShift;,Q,EnterShift;,Q,EnterShift;,Q,Enter
Save and quitNormal modeShiftZ,ShiftZShiftZ,ShiftZShiftZ,ShiftZ
Quit without savingNormal modeShiftZ,ShiftQShiftZ,ShiftQShiftZ,ShiftQ
Split the window horizontallyNormal modeCtrlW,SCtrlW,SCtrlW,S
Split the window verticallyNormal modeCtrlW,VCtrlW,VCtrlW,V
Go to the next windowNormal modeCtrlW,WCtrlW,WCtrlW,W
Close the windowNormal modeCtrlW,QCtrlW,QCtrlW,Q
Make all windows the same sizeNormal modeCtrlW,=CtrlW,=CtrlW,=
Show the key map: which keys Vim uses mostDarker orange = used by more shortcuts

Move around in Vim: end of line, top and end of file

Go to a line number
Type the number and G, such as 42G, or :42 and Enter.

Delete, copy and paste in Vim

Delete every line
In Normal mode, gg then dG deletes from the first line to the last; :%d and Enter does the same.
Select all and copy
ggVG selects the whole file; then y copies it. To copy to the system clipboard, use "+y (Vim must be built with clipboard support).
Comment lines
Plain Vim has no comment key. Select lines with Ctrl+V, press I, type # or // and press Esc to add it to every line; plugins such as vim-commentary add gcc.

Vim modes: insert, visual and replace

Save, quit and split windows in Vim

Vim keys in VS Code and other apps
The Vim extension for VS Code, IdeaVim for JetBrains IDEs, and the built-in Vim modes in Zed and Obsidian accept these same keys.

Vim keyboard shortcuts: questions

How do I exit Vim?
Press Esc to get back to Normal mode, then type :q and press Enter. Use :q! to quit without saving, or :wq (or ZZ) to save and quit.
Why do Vim keys type letters instead of running commands?
You are in Insert mode. Press Esc to return to Normal mode, where letters are commands; press i to go back to typing.

These are the default key bindings in Vim 9.1, as published by Bram Moolenaar and the Vim community. Shortcuts that need an extension, an add-in or a changed keymap are left out. Where two combinations do the same thing, both are shown.

Single-system lists: Vim keyboard shortcuts for Mac, Vim keyboard shortcuts for Windows, Vim keyboard shortcuts for Linux.

Each shortcut has its own page with the keys for every system, related shortcuts and the same action in other apps. The printable cheat sheet fits the whole list on one or two pages.