80 Vim Keyboard Shortcuts

Vim shortcuts have been a learning curve for me. Mastering a few Vim shortcut keys has quickly led to greater productivity and achievement. You won’t need a mouse while moving around Vim, because everything in Vim can be done with the help of Vim keyboard shortcuts.

Since Vim is a text editor, you need to apply all your brainpower to coding rather than wasting it on how to use the mouse and keyboard simultaneously. Despite various rich text editors, familiarity with Vim will help every Linux user. Download the Vim Shortcuts PDF.

Editing Shortcuts

ActionVim Shortcuts
Replace a single characterr
Join the line below to the current onej
Change an entire linecc
Change to the end of the worldcw
Change to the end of the linec$
Delete the character at the cursor and substitute the texts
Delete the line at the cursor and substitute the textS
Transpose two lettersxp
Undou
Repeat the last command.

Cursor Movement Shortcuts

ActionVim shortcuts
Move lefth
Move downj
Move upk
Move rightl
Jump by the start of wordsw
Jump by wordsW
Jump to the end of wordse
Jump to the end of words with no punctuationE
Jump backward by wordsb
Jump backward by words with no punctuationB
Start of line0
The first non-blank character of the line^
End of line$
Go To commandG
Start insert mode at the cursori
Insert at the beginning of the lineI
Append after the cursora
Append at the end of the lineA
Open a blank line below the current lineo
Open a blank line above the current lineO
Append at the end of the wordea
Exit insert modeEsc

Visual Mode Shortcuts

ActionVim Cheat Sheet
Start visual mode, mark lines, and then do the commandv
Start Linewise visual modeV
Move to other ends of the marked areao
Start visual block modeCtrl + V
Move to other corners of the blockO
Mark a wordaw
A () blockab
A {} blockaB
Inner () blockib
Inner {} blockiB
Exit visual modeEsc

Cut & Paste Shortcuts

ActionVim Shortcut keys
Yank (copy) a lineyy
Yank 2 lines2yy
Yank wordyw
Yank to end of liney$
Paste the clipboard after the cursorp
Paste before cursorP
Cut a linedd
Cut the current worddw
Cut current characterx

Visual Commands Shortcuts

ActionVim Keyboard Shortcuts
Shift right>
Shift left<
yank marked texty
Delete marked textd
Switch case~

Search & Replace Shortcuts

ActionVim Cheat Sheet
Search for pattern/pattern
Search backward for pattern?pattern
Repeat the search in the same directionn
Repeat the search in the opposite directionN
Replace all old with new throughout the file:%s/old/new/g
Replace all old with new throughout the file with confirmations:%s/old/new/gc

Working with Files Shortcuts

ActionVim Cheat Sheet
Edit a file in a new buffer:e filename
Go to the next buffer:bnext
Go to the previous buffer:bprev
Delete a buffer:bd
Open a file in a new buffer and split the window:sp filename
Split windowsCtrl + ws
Switch between windowsCtrl + ww
Quit a windowCtrl + wq
Split windows verticallyCtrl + wv

Exit Shortcuts

ActionVim Keyboard Shortcuts
Write (save) the file, but don’t exist:w
Write (save) and quit:wq
Quit (fails if anything has changed):q
Quit and throw away changes:q!

Vim is a free, open-source, and popular text editor for Linux users. However, it is not everyone’s cup of tea to work with. It would be best if you learned a variety of Vim shortcuts to get your hands on it. Emacs is another text editor that you can work with instead of Vim. Have a look at the Emacs Shortcuts list here.

READ NEXT:

Back to top button