[tmux.app] tmux cheat sheet
Press Ctrl+b, let go, then press the key. ↻ = repeatable without the prefix · 3.8 = new in that version
From your shell
tmux | Start a new session |
tmux new -s work | New session named work |
tmux ls | List sessions |
tmux attach | Attach to the last session |
tmux attach -t work | Attach to work |
tmux new -A -s work | Attach to work, or create it |
tmux rename -t work dev | Rename a session |
tmux kill-session -t work | Kill one session |
tmux kill-server | Kill every session |
tmux source ~/.tmux.conf | Reload your config |
tmux list-keys -N | List key bindings |
tmux -V | Show the version |
Sessions
| d | Detach (session keeps running) |
| s | Choose a session from a tree |
| Shift+Tab | Session switcher, type to filter 3.8 |
| $ | Rename the session |
| () | Previous / next session |
| L | Last (previous) session |
| D | Choose a client to detach |
| Ctrl+z | Suspend the client |
Windows
| c | New window |
| np | Next / previous window |
| 0…9 | Go to window 0 to 9 |
| l | Last (previous) window |
| ' | Prompt for a window index |
| w | Choose a window from a tree |
| Tab | Window switcher, type to filter 3.8 |
| f | Find a window by text |
| , | Rename the window |
| . | Move the window to an index |
| & | Kill the window (asks first) |
| Alt+nAlt+p | Next / previous window with an alert |
Floating panes
| * | New floating pane 3.7 |
| @ | Float a tiled pane / tile a floating one 3.8 |
| g | Move floating pane, then a key below 3.8 |
| T | Set the pane title 3.8 |
Copy mode & buffers
| [ | Enter copy mode (scroll back) |
| PgUp | Copy mode, one page up |
| ] | Paste the newest buffer |
| = | Choose a buffer to paste |
| # | List paste buffers |
| - | Delete the newest buffer |
Panes
| % | Split left / right |
| " | Split top / bottom |
| ↑↓←→ | Move to the pane in that direction ↻ |
| o | Next pane |
| ; | Last (previous) pane |
| q | Show pane numbers, then press one |
| z | Zoom / unzoom the pane |
| x | Kill the pane (asks first) |
| ! | Break the pane into a new window |
| {} | Swap with the previous / next pane |
| Ctrl+oAlt+o | Rotate panes forward / back |
| Ctrl+arrows | Resize by 1 cell ↻ |
| Alt+arrows | Resize by 5 cells ↻ |
| Space | Next layout |
| Alt+1…5 | Even-h, even-v, main-h, main-v, tiled |
| Alt+6Alt+7 | Mirrored main-h / main-v layouts 3.5 |
| E | Spread panes out evenly |
| mM | Mark / clear the marked pane |
| > | Pane menu |
[tmux.app] tmux cheat sheet
Copy mode, prompts, help, mouse and your own prefix
Copy mode keys
| Action | vi | emacs |
|---|---|---|
| Exit copy mode | q | q Esc |
| Move the cursor | h j k l | arrows |
| Page up / down | Ctrl+b Ctrl+f | Alt+v Ctrl+v |
| Half page up / down | Ctrl+u Ctrl+d | Alt+↑ Alt+↓ |
| Top / bottom of history | g G | Alt+< Alt+> |
| Start / end of line | 0 $ | Ctrl+a Ctrl+e |
| Next / previous word | w b | Alt+f Alt+b |
| Search down / up | / ? | Ctrl+s Ctrl+r |
| Next / previous match | n N | n N |
| Start selection | Space | Ctrl+Space |
| Rectangle selection | v | R |
| Select the whole line | V | — |
| Copy and exit | Enter | Alt+w |
| Clear selection | Esc | Ctrl+g |
| Go to line number | : | g |
Help from the shell
tmux list-keys -N | Every binding, with a note |
tmux list-keys -T copy-mode-vi | The vi copy mode table |
tmux list-commands | All 92 commands |
man tmux | The full manual |
Prompt, help & display
| : | Command prompt |
| ? | List every key binding |
| / | Describe one key |
| C | Customize options and keys |
| ~ | Show messages |
| i | Window info in the status line |
| < | Window menu |
| t | Big clock |
| r | Redraw the client |
| Ctrl+b | Send Ctrl+b to the program |
| Shift+arrows | Pan a window bigger than the client ↻ |
| Delete | Stop panning, follow the cursor ↻ |
After prefix g (floating pane)
| ↑↓←→ | Move to the top, bottom, left or right edge |
| 1234 | Move to a corner (TL, TR, BL, BR) |
| Alt+arrows | Half the window, at that edge |
| Alt+1…4 | A quarter of the window, in that corner |
| 0 | Fill the whole window |
| ,. | Menus: move, or move and resize |
Mouse (on by default in 3.8)
| Click a pane | Select it |
| Drag a border | Resize panes |
| Wheel up | Scroll back (copy mode) |
| Drag text | Select and copy |
| Double / triple click | Copy a word / line |
| Middle click | Paste |
| Click the status line | Switch window |
| Right click | Pane or window menu |
| Ctrl + drag | Draw a floating pane |
Older than 3.8? Add set -g mouse on. Hold Shift to use your terminal's own selection in most terminals.
Use Ctrl+a as the prefix
set -g prefix C-a
unbind C-b
bind C-a send-prefix
Put it in ~/.tmux.conf, then run tmux source ~/.tmux.conf. Vi keys in copy mode: set -g mode-keys vi.
Targets for -t
work | session |
work:2 | window 2 of work |
work:2.1 | pane 1 of that window |
:.+ | next pane here |
$0 @3 %7 | session, window, pane IDs |