80 Vim Shortcuts for Linux

Download Vim Shortcuts Cheat Sheet

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

List of Vim Shortcuts

Vim being a text editor you need to apply all your brainpower in 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 Vim Shortcuts PDF.

Download Vim Cheat Sheet

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 word cw
Change to the end of the line c$
Delete the character at the cursor and substitute text s
Delete line at the cursor and substitute 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 end of words e
Jump to end of words 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 end of the word ea
Exit insert mode Esc

Read More: 70 ZBrush Shortcuts for Windows

Visual Mode Shortcuts

Action Vim Cheat Sheet
Start visual mode, mark lines, then do 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

Read More: 60 Solidworks Shortcuts for Windows

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 search in the same direction n
Repeat 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 :%s/old/new/gc

Read More: 20 Putty Shortcuts for Windows

Working with Files Shortcuts

Action Vim 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 windows Ctrl + ws
Switch between windows Ctrl + ww
Quit a window Ctrl + wq
Split windows vertically Ctrl + wv

Exit Shortcuts

Action Vim 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 most popular text editor for Linux users. However, it is not everyone’s cup of tea to work with. You need to learn a variety of Vim shortcuts to get your hands on it. Emacs is another text editor that you work with instead of Vim. Have a look at the Emacs Shortcuts list here.


What is Ctrl-R in Vim?

Ctrl-R keys allow entering a command in command mode to paste the current paste buffer contents.

What does Ctrl-A do in Vim?

Ctrl-A keys allow incrementing the next number in normal mode.


Related Articles

Leave a Reply

Your email address will not be published.

Back to top button