Shortcuts Vim for Linux

76 shortcuts6,096 views
Open Trainer

Cursor Movement

Action
Move left
Move down
Move up
Move right
Jump by start of words
Jump by words
Jump to end of words
Jump to end of words (no punctuation)
Jump backward by words (punctuation considered words)
Jump backward by words (no punctuation)
Start of line
First non-blank character of line
End of line
Go To command (prefix with number)
Start insert mode at cursor
Insert at the beginning of the line
Append after the cursor
Append at the end of the line
Open (append) blank line below current line (no need to press return)
Open blank line above current line
Append at end word
Exit insert mode

Editing

Action
Replace a single character (does not use insert mode)
Join line below to the current one
Change (replace) an entire line
Change (replace) to the end of word
Change (replace) to the end of line
Delete character at cursor and subsitute text
Delete line at cursor and substitute text (same as cc)
Transpose two letters (delete and paste, technically)
Undo
Repeat last command

Making text (Visual mode)

Action
Start visual mode, mark lines, then do command (such as y-yank)
Start Linewise visual mode
Move to other end of marked area
Start visual block mode
Move to other corner of block
Mark a word
A () block (with braces)
A {} block (with brackets)
Inner () block
Inner {} block
Exit visual mode

Visual commands

Action
Shift right
Shift left
yank (copy)marked text
Delete marked text
Switch case

Cut and Paste

Action
Yank (copy) a line
Yank 2 lines
Yank word
Yank to end of line
Put (paste) the clipboard after cursor
Put (paste) before cursor
Delete (cut) a line
Delete (cut) the current word
Delete (cut) current character

Exiting

Action
Write (save) the file, but don't exit
Write (save) and quit
Quit (fails if anything has changed)
Quit and throw away changes

Search/Replace

Action
Search for pattern
Search backward for pattern
Repeat search in same direction
Repeat search in opposite direction
Replace all old with new throughout file
Replace all old with new throughout file with confirmations

Working with multiple files

Action
Edit a file in a new buffer
Go to next buffer
Go to previous buffer
Delete a buffer (close a file)
Open a file in a new buffer and split window
Split windows
Switch between windows
Quit a window
Split windows vertically