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
Action
Vim Shortcuts
Replace a single character
r
Join the line below to the current one
j
Change an entire line
cc
Change to the end of the world
cw
Change to the end of the line
c$
Delete the character at the cursor and substitute the text
s
Delete the line at the cursor and substitute the text
S
Transpose two letters
xp
Undo
u
Repeat the last command
.
Cursor Movement Shortcuts
Action
Vim shortcuts
Move left
h
Move down
j
Move up
k
Move right
l
Jump by the start of words
w
Jump by words
W
Jump to the end of words
e
Jump to the end of words with no punctuation
E
Jump backward by words
b
Jump backward by words with no punctuation
B
Start of line
0
The first non-blank character of the line
^
End of line
$
Go To command
G
Start insert mode at the cursor
i
Insert at the beginning of the line
I
Append after the cursor
a
Append at the end of the line
A
Open a blank line below the current line
o
Open a blank line above the current line
O
Append at the end of the word
ea
Exit insert mode
Esc
Visual Mode Shortcuts
Action
Vim Cheat Sheet
Start visual mode, mark lines, and then do the command
v
Start Linewise visual mode
V
Move to other ends of the marked area
o
Start visual block mode
Ctrl + V
Move to other corners of the block
O
Mark a word
aw
A () block
ab
A {} block
aB
Inner () block
ib
Inner {} block
iB
Exit visual mode
Esc
Cut & Paste Shortcuts
Action
Vim Shortcut keys
Yank (copy) a line
yy
Yank 2 lines
2yy
Yank word
yw
Yank to end of line
y$
Paste the clipboard after the cursor
p
Paste before cursor
P
Cut a line
dd
Cut the current word
dw
Cut current character
x
Visual Commands Shortcuts
Action
Vim Keyboard Shortcuts
Shift right
>
Shift left
<
yank marked text
y
Delete marked text
d
Switch case
~
Search & Replace Shortcuts
Action
Vim Cheat Sheet
Search for pattern
/pattern
Search backward for pattern
?pattern
Repeat the search in the same direction
n
Repeat the search in the opposite direction
N
Replace all old with new throughout the file
:%s/old/new/g
Replace all old with new throughout the file with confirmations
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.