Skip to content

Instantly share code, notes, and snippets.

@jbgo
Last active December 26, 2015 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbgo/7119324 to your computer and use it in GitHub Desktop.
Save jbgo/7119324 to your computer and use it in GitHub Desktop.
tmux cheat sheet

tmux config

~/.tmux.conf

send the prefix

Default prefix: ^b

Getting help

  • Read the man page: man tmux
  • List all key bindings: tmux list-keys | less

Sessions

  • List running sessions: tmux list-sessions
  • New named session: tmux new -s NAME
  • Switch sessions: tmux switch -t NAME
  • Attach to a session: tmux attach -t NAME
  • Detach current session: ^b d
  • Rename current session: ^b $
  • Saving sessions and restoring sessions a reboot:
    I don't think this is a standard tmux feature. Here are some projects to check out that provide this functionality: tmuxinator, tmux-resurrect, or plain old bash scripts

Windows

  • Create a new window: ^b c
  • List windows: ^b w
  • Rename a window: ^b ,
  • Close a window: ^b &

Panes

  • Split pane vertical (opens new pane to the right): ^b %
  • Split pane horizontal (opens new pane below): ^b "
  • Switch between panes: ^b up|down|left|right - up, down, left, right are the arrow keys
  • Swap panes: ^b { or ^b }
  • Resize pane: ^b :resize-pane -U|D|L|R NUM - Up, Down, Left, Right, NUM cells
  • Kill pane: ^b x

Scrolling in panes

  • Enter scroll mode: ^b [
  • Quit scroll mode: q
  • Scroll in scroll mode: j (down), k (up), or page up/down

copy/paste

  • Enter copy mode: ^b [
  • Begin selection: space
  • End selection (and copy text): enter
  • Paste test: ^b ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment