Skip to content

Tmux Cheatsheet

Antoniy Chonkov edited this page Dec 28, 2019 · 1 revision

Tmux Wiki

General

By default Tmux prefix key is set to Ctrl-b but we've remapped it to Ctrl-a.

  • tmux new: start new tmux session
  • tmux new -s <name>: start new tmux sessions with specified name
  • <prefix>-:: enter command mode
  • <prefix>-?: show available commands and key bindings
  • Ctrl-a-a: send Ctrl-a prefix to current shell (hold down Ctrl and press a twice)
  • <prefix>-l: sends Ctrl-l to the shell for 'clear screen' function to work

Windows

Navigation

  • <prefix>-c: create new window
  • <prefix>-C: create new window with specified name
  • Alt-[h,l]: switch to previous/next window
  • Alt-[Left,Right]: switch to previous/next window
  • <prefix>-[1-9]: switch to specified window number

Misc

  • <prefix>-,: rename window
  • Alt-Shift-Left: move window to the left
  • Alt-Shift-Right: move window to the right

Panes

Splits

  • <prefix>-s: create new horizontal split pane
  • <prefix>-v: create new vertical split pane
  • <prefix>-S: create new horizontal split for whole window - if you have for example 2 vertical splits, this will make horizontal split beneath both, not just the current one.
  • <prefix>-V: create new vertical split for whole window - if you have 2 or more horizontal splits, this will make vertical split to the right of all of them, not just the current one.
  • <prefix>--: create horizontal split pane
  • <prefix>-|: create vertical split pane
  • <prefix>-_: create new horizontal split for whole window - if you have for example 2 vertical splits, this will make horizontal split beneath both, not just the current one.
  • <prefix>-\: create new vertical split for whole window - if you have 2 or more horizontal splits, this will make vertical split to the right of all of them, not just the current one.

Navigation

  • Ctrl-[h,j,k,l]: move to pane on the left/down/up/right
  • <prefix>-[Left,Down,Up,Right]: move to pane on the left/down/up/right
  • <prefix>-Shift-[h,j,k,l]: resize pane - press leade (Ctrl-a) without releasing Ctrl press (multiple times if needed) h, j, k or l to resize the pane in whatever direction needed.

Misc

  • <prefix>-x: kill pane
  • Alt-z: toggle pane zoom - triggered once a pane becomes fullscreen and a Z flag is shown in the window indicator in status bar, triggered second time - the layout is restored as before.
  • <prefix>space: change pane layout
  • <prefix>-a: synchronize all panes in the current window - all typed input will go to all panes

Management

  • <prefix>-N: create new session with specified name
  • <prefix>-w: show list of sessions and windows with preview and user can navigate to one with j,k and select with enter
  • <prefix>-W: show lif of just session with preview and the user can navigate (j,l) to one and switch to it with enter
  • <prefix>-d: detach from the current session
  • <prefix>-D: show a list of attached terminal and choose one via j,k to be detached and select with enter
  • <prefix>-r: reload tmux config

Clone this wiki locally