tmux cheatsheet
Basic usage
In order of importance (for me):
(<prefix> = Ctrl+b)
-
Shortcut help:
<prefix> ?thenqto exit help -
Split window:
-
<prefix> %splits left/right -
<prefix> "splits top/bottom
-
-
Move cursor to split:
<prefix> up/down/left/right(arrow keys) -
Name session so I known what I’m re-attaching to later:
<prefix> $ -
Detach from session
<prefix> d(remains running in background) -
List sessions (at CLI, outside of tmux):
$ tmux ls -
Attach to session:
$ tmux attach -t foo(will probably alias this) -
Create window:
<prefix> c(same as GNU screen) -
Switch to "next" window:
<prefix> n -
"Zoom" a split (so I can copy text from terminal)
<prefix> z-
Toggle Zoom back off by using shortcut again.
-
By the way, whoever thought to describe the split options as "left/right" and "top/bottom" has my blessing! Awesome descriptive-naming! (I’m saving this example.)
Advanced usage
-
Copy mode (scrollable buffer):
<prefix> [(same as GNU screen)-
Arrow keys or pgup/pgdn, etc. to move around buffer
-
qto exit copy mode (no need for prefix, just q)
-
-
Resize a split:
<prefix> alt+up/down/left/right(arrow keys)
Update: Here’s how I copy-paste now:
<prefix> [ <- to enter copy mode
h/j/k/l Ctrl-u/Ctrl-d <- to move around buffer
Space <- to start selecting
(then same movement keys to select)
Enter <- finish selection
<prefix> ] <- to paste at cursor