Skip to content

Instantly share code, notes, and snippets.

@robert-claypool
Last active March 14, 2019 21:33
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 robert-claypool/34ca7efc0b9af5871aaf26eec73cbe77 to your computer and use it in GitHub Desktop.
Save robert-claypool/34ca7efc0b9af5871aaf26eec73cbe77 to your computer and use it in GitHub Desktop.
My tmux Notes

The default prefix binding is CTRL-B

Sessions

  • tmux new -s my_session
  • tmux detach (prefix + d)
  • tmux list-sessions
  • tmux attach -t my_session

To kill a session, use prefix + :kill-session.

Windows

  • tmux new-window (prefix + c)
  • tmux rename-window (prefix + ,)
  • tmux next-window (prefix + n)
  • tmux previous-window (prefix + p)

Panes (splits)

  • vertical split: prefix + %
  • horizontal split: prefix + "
  • swap panes: prefix + o
  • kill pane: prefix + x
  • toggle pane zoom: prefix + z

Copy Mode

This assumes you are using vi style key bindings:

  • To enable vi bindings, e.g. h/j/k/l navigation: tmux set-window-option -g mode-keys vi
    1. Enter copy mode: prefix + [
    1. Hit Space to start a selection
    1. Navigate around and hit Enter to copy the selection
    1. Now paste what you put in the tmux buffer: prefix + ]

Resurrect

  • save: prefix + ctrl-s
  • restore: prefix + ctrl-r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment