Vim (Linux)

Working with multiple files

Quit a window

Ctrl + wq

All hotkeys for Vim (Linux)

Cursor Movement
Move left

h

Cursor Movement
Move down

j

Cursor Movement
Move up

k

Cursor Movement
Move right

l

Cursor Movement
Jump by start of words

w

Cursor Movement
Jump by words

W

Cursor Movement
Jump to end of words

e

Cursor Movement
Jump to end of words (no punctuation)

E

Cursor Movement
Jump backward by words (punctuation considered words)

b

Cursor Movement
Jump backward by words (no punctuation)

B

Cursor Movement
Start of line

0

Cursor Movement
First non-blank character of line

^

Cursor Movement
End of line

$

Cursor Movement
Go To command (prefix with number)

G

Cursor Movement
Start insert mode at cursor

i

Cursor Movement
Insert at the beginning of the line

I

Cursor Movement
Append after the cursor

a

Cursor Movement
Append at the end of the line

A

Cursor Movement
Open (append) blank line below current line (no need to press return)

o

Cursor Movement
Open blank line above current line

O

Cursor Movement
Append at end word

ea

Cursor Movement
Exit insert mode

Esc

Editing
Replace a single character (does not use insert mode)

r

Editing
Join line below to the current one

J

Editing
Change (replace) an entire line

cc

Editing
Change (replace) to the end of word

cw

Editing
Change (replace) to the end of line

c$

Editing
Delete character at cursor and subsitute text

s

Editing
Delete line at cursor and substitute text (same as cc)

S

Editing
Transpose two letters (delete and paste, technically)

xp

Editing
Undo

u

Editing
Repeat last command

.

Making text (Visual mode)
Start visual mode, mark lines, then do command (such as y-yank)

v

Making text (Visual mode)
Start Linewise visual mode

V

Making text (Visual mode)
Move to other end of marked area

o

Making text (Visual mode)
Start visual block mode

Ctrl + v

Making text (Visual mode)
Move to other corner of block

O

Making text (Visual mode)
Mark a word

aw

Making text (Visual mode)
A () block (with braces)

ab

Making text (Visual mode)
A {} block (with brackets)

aB

Making text (Visual mode)
Inner () block

ib

Making text (Visual mode)
Inner {} block

iB

Making text (Visual mode)
Exit visual mode

Esc

Visual commands
Shift right

>

Visual commands
Shift left

<

Visual commands
yank (copy)marked text

y

Visual commands
Delete marked text

d

Visual commands
Switch case

~

Cut and Paste
Yank (copy) a line

yy

Cut and Paste
Yank 2 lines

2yy

Cut and Paste
Yank word

yw

Cut and Paste
Yank to end of line

y$

Cut and Paste
Put (paste) the clipboard after cursor

p

Cut and Paste
Put (paste) before cursor

P

Cut and Paste
Delete (cut) a line

dd

Cut and Paste
Delete (cut) the current word

dw

Cut and Paste
Delete (cut) current character

x

Exiting
Write (save) the file, but don't exit

:w

Exiting
Write (save) and quit

:wq

Exiting
Quit (fails if anything has changed)

:q

Exiting
Quit and throw away changes

:q!

Search/Replace
Search for pattern

/pattern

Search/Replace
Search backward for pattern

?patten

Search/Replace
Repeat search in same direction

n

Search/Replace
Repeat search in opposite direction

N

Search/Replace
Replace all old with new throughout file

:%s/old/new/g

Search/Replace
Replace all old with new throughout file with confirmations

:%s/old/new/gc

Working with multiple files
Edit a file in a new buffer

:e filename

Working with multiple files
Go to next buffer

:bnext

Working with multiple files
Go to previous buffer

:bprev

Working with multiple files
Delete a buffer (close a file)

:bd

Working with multiple files
Open a file in a new buffer and split window

:sp filename

Working with multiple files
Split windows

Ctrl + ws

Working with multiple files
Switch between windows

Ctrl + ww

Working with multiple files
Quit a window

Ctrl + wq

Working with multiple files
Split windows vertically

Ctrl + wv

Similar combinations for other applications