tmux cheatsheet


Some useful tips for tmux

WARNING: Some of the keybindings maybe overrided by your ~/.tmux.conf file


reassume previous session:

tmux attach


personal configuration file is ~/.tmux.conf

change key binding prefix to Ctrl+a

set -g prefix C-a

Vi mode

# change key bindings
set -g status-keys vi

setw -g mode-keys vi

# use vi's visual mode key and copy key
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection


Ctrl-b %    # Split the current window into two panes
Ctrl-b q    # Show pane numbers (used to switch between panes)
Ctrl-b o    # Switch to the next pane

Ctrl-b {    # Move current pane left
Ctrl-b }    # Move current pane right

Ctrl-b <space>      # Switch to different pane layouts

Ctrl-b : "break-pane [-d]"      # Make current pane a new window

define custom keys to switch panes quickly and with ease:

# use alt + hjkl to select panes
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-k select-pane -U
bind -n M-j select-pane -D


Ctrl-b c    # Create new window
Ctrl-b ,    # Rename the current window
Ctrl-b &    # Kill the current window

Ctrl-b w    # List all windows
Ctrl-b f    # Find windows by name

Ctrl-b p    # Move to the previous window
Ctrl-b n    # Move to the next window
Ctrl-b l    # Move to last used window
Ctrl-b <n>  # Move to the <n>th window


Ctrl-b d    # Detach current client

Ctrl-b ?    # List all keybindings
Ctrl-b :    # Command prompt

Copy Mode

Ctrl+b [    # switch to copy mode
# if in vi mode, use vi movement keys to move the cursor, q to quit
Ctrl+b ]    # paste to tmux