LinuxShortcuts

80 Vim Shortcuts for Linux

List of Vim Shortcuts

Learn Vim Shortcuts for Linux

Editing Shortcuts

Action Vim Shortcuts
Replace a single character r
Join line below to the current one j
Change an entire line cc
Change to the end of word cw
Change to the end of line c$
Delete character at cursor and subsitute text s
Delete line at cursor and substitute text S
Transpose two letters xp
Undo u
Repeat last command .

Cursor Movement Shortcuts

Action Vim Shortcut keys
Move left h
Move down j
Move up k
Move right l
Jump by 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 no punctuation B
Start of line 0
First non-blank character of line ^
End of line $
Go To command G
Start insert mode at cursor i
Insert at the beginning of the line I
Append after the cursor a
Append at the end of the line A
Open blank line below current line o
Open blank line above current line O
Append at end word ea
Exit insert mode Esc

Visual Mode Vim Shortcuts

Action Vim Shortcut keys
Start visual mode, mark lines, then do command v
Start Linewise visual mode V
Move to other end of marked area o
Start visual block mode Ctrl + V
Move to other corner of 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 cursor p
Paste before cursor P
Cut a line dd
Cut the current word dw
Cut current character x

Visual Commands Shortcuts

Action Vim Shortcut keys
Shift right >
Shift left <
yank marked text y
Delete marked text d
Switch case ~

Search & Replace Shortcuts

Action Vim Shortcut keys
Search for pattern /pattern
Search backward for pattern ?pattern
Repeat search in same direction n
Repeat search in opposite direction N
Replace all old with new throughout file :%s/old/new/g
Replace all old with new throughout file with confirmations :%s/old/new/gc

Working with Files Shortcuts

Action Vim Shortcut keys
Edit a file in a new buffer :e filename
Go to next buffer :bnext
Go to previous buffer :bprev
Delete a buffer :bd
Open a file in a new buffer and split 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 Shortcut keys
Write (save) the file, but don’t exit :w
Write (save) and quit :wq
Quit (fails if anything has changed) :q
Quit and throw away changes :q!

Download Vim Shortcuts Cheat Sheet

Download Vim Shortcuts Cheat Sheet

READ NEXT:

Devil

Hello, My name is Pratik, Founder of Tutorial Tactic. Only the mistakes will help you learn and Tutorial Tactic drives you to stand strong and learn even harder & achieve success!

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button