Skip to content

Instantly share code, notes, and snippets.

@esayler
Last active September 17, 2015 21:55
Show Gist options
  • Save esayler/3009f73db9330133913d to your computer and use it in GitHub Desktop.
Save esayler/3009f73db9330133913d to your computer and use it in GitHub Desktop.

tmux notes

Commands

tmux new-session

tmux new -s SessionName

tmux new -s SessionName -n WindowName

tmux attach -t SessionName

General

PREFIX --> <C-a>

key action/effect
PREFIX d detach from session
PREFIX : Enter command mode
PREFIX c Create new window (same as new-window)
PREFIX {num} Select window by {num}
PREFIX w Display list of windows in current session
PREFIX , Rename window
PREFIX & close current window (y/n ?)
PREFIX \ vertical split
PREFIX - horizontal split
PREFIX o cycle open panes (also mapped to <C-a><C-a>)
PREFIX q display pane numbers, type number to go to
PREFIX x close current pane (y/n ?)
PREFIX z toggle pane zoom
PREFIX <SPACE> cycle through pane layouts
PREFIX { move pane left
PREFIX } move pane right

Copy Mode

key action
PREFIX [ enter copy mode
q, <CR> exit copy mode
PREFIX ] paste current buffer contents
PREFIX = list of paste buffers and pastes selected buffer contents
v "visual-mode" (custom)
y copy or "yank" selected text to the buffer (custom)

Copy Mode Movement (setw -g mode-keys vi)

key action
h, j, k, l vi movement
w one word forward
b one word back
f {char} move to next occurrence of specified {char}
F {char} move to prev occurrence of specified {char}
<C-b> scroll up one page (remap to <C-k>??)
<C-f> scroll down one page (remap to <C-j>??)
<C-u> scroll up half page (remap ??)
<C-d> scroll down half page (remap??)
L move to bottom line
M move to middle line
H move to top line
g jump to top
G jump to bottom
? search upward
/ search downward

Other Commands

show-buffer

capture-pane

list-buffers

choose-buffer

save-buffer [filename]

source-file ~/.tmux.conf

Misc

key action
d detach
t big clock
? list shortcuts
: cmd prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment