Vim+TmuxMaster

Keyboard Shortcuts Cheatsheet

Quick reference guide for all essential Vim and Tmux commands

Essential Commands

Basic Movement

Cursor Movement
h Move left
j Move down
k Move up
l Move right
Word Movement
w Next word
e End of word
b Previous word
ge End of previous word
Line Movement
0 Start of line
^ First non-blank character
$ End of line
Document Movement
gg Top of file
G Bottom of file
{ Previous paragraph
} Next paragraph
Ctrl + f Page down
Ctrl + b Page up

Editing Operations

Insert Mode
i Insert at cursor
I Insert at line beginning
a Append after cursor
A Append at line end
o New line below
O New line above
Esc Exit Insert mode
Deleting & Changing
x Delete character
dd Delete line
dw Delete word
cc Change line
cw Change word
C Change to line end
Copy & Paste
yy Yank (copy) line
yw Yank word
y$ Yank to line end
p Paste after cursor
P Paste before cursor

Visual Mode

Entering Visual Mode
v Character-wise visual
V Line-wise visual
Ctrl + v Block-wise visual
gv Reselect last selection
Visual Mode Operations
d Delete selection
y Yank selection
c Change selection
> Indent
< Outdent
~ Switch case

Search & Replace

Search
/pattern Search forward
?pattern Search backward
n Next match
N Previous match
* Search for word under cursor
# Search backward for word
Replace
:s/old/new/ Replace first occurrence in line
:s/old/new/g Replace all in line
:%s/old/new/g Replace all in file
:%s/old/new/gc Replace with confirmation

Text Objects

Inner vs Around
i Inner (inside)
a Around (includes delimiter)
Text Object Examples
ciw Change inner word
di" Delete inside quotes
ya( Yank around parentheses
vi{ Select inside braces

Marks & Jumps

Marks
m{letter} Set mark at cursor
`{letter} Jump to mark
'{letter} Jump to line of mark
:marks List all marks
Jumps
Ctrl + o Jump back
Ctrl + i Jump forward
g; Go to previous change
g, Go to next change

Session Management

Creating & Attaching
tmux Start new session
tmux new -s name Start new named session
tmux attach Attach to last session
tmux attach -t name Attach to named session
tmux ls List sessions
Session Control
Prefix + d Detach from session
Prefix + $ Rename session
Prefix + s List sessions
tmux kill-session -t name Kill session

Window Management

Window Operations
Prefix + c Create window
Prefix + & Kill window
Prefix + , Rename window
Prefix + . Move window
Window Navigation
Prefix + n Next window
Prefix + p Previous window
Prefix + 0-9 Go to window #
Prefix + f Find window
Prefix + w List windows

Pane Management

Creating Panes
Prefix + % Split vertically
Prefix + " Split horizontally
Pane Navigation
Prefix + arrow key Move between panes
Prefix + o Cycle through panes
Prefix + q Show pane numbers
Prefix + x Kill pane
Prefix + z Toggle pane zoom

Tmux Prefix

Ctrl + b (Default prefix key)

All tmux commands are prefixed with this key combination. In examples, this is shown as Prefix.

Many users remap this to Ctrl + a in their .tmux.conf for easier access.

Copy Mode

Accessing Copy Mode
Prefix + [ Enter copy mode
Prefix + PgUp Enter copy mode & scroll up
q Quit copy mode
Copy Mode Navigation
h,j,k,l Basic movement
w,b Word movement
Ctrl + f/b Page down/up
g,G Top/bottom of buffer
/ Search forward
? Search backward
Copying Text
Space Start selection
Enter Copy selection
Esc Clear selection
Prefix + ] Paste buffer

Advanced Pane Operations

Resizing Panes
Prefix + Alt + arrow Resize pane
Prefix + : Command mode
resize-pane -D 10 Resize down 10 cells
Pane Management
Prefix + { Move pane left
Prefix + } Move pane right
Prefix + ! Break pane to window
Prefix + Space Cycle layouts

Configuration Commands

Common Commands
Prefix + : Enter command mode
set -g mouse on Enable mouse support
set-window-option -g mode-keys vi Use vi keys in copy mode
source-file ~/.tmux.conf Reload config file

Scripting & Automation

Shell Commands
tmux new-session -d -s name Create detached session
tmux new-window -t name:1 -n title Create new window in session
tmux split-window -h -t name:1.0 Split window horizontally
tmux send-keys -t name:1 "command" C-m Send command to window

Interactive Keyboard

Hover over a key to see its Vim function in Normal mode

Esc
1
2
3
4
5
6
7
8
9
0
-
=
Tab
w
e
r
t
y
u
i
o
p
[
]
\
Caps
a
s
d
f
g
h
j
k
l
;
'
Enter
Shift
v
x
c
b
n
m
,
.
/
Shift
Ctrl
Alt
Space
Alt
Ctrl