Skip to content

Instantly share code, notes, and snippets.

@WesternStar
Last active January 20, 2016 20:46
Show Gist options
  • Save WesternStar/5b5314c63491f0f2b507 to your computer and use it in GitHub Desktop.
Save WesternStar/5b5314c63491f0f2b507 to your computer and use it in GitHub Desktop.

#Tmux-modern

start new:

tmux

start new with session name:

tmux new -s myname

attach:

tmux a  #  (or at, or attach)

attach to named:

tmux a -t myname

list sessions:

tmux ls

kill session:

tmux kill-session -t myname

cheat sheet for tmux with sessionist,pane,ressurect,continum and tmux sensible as a substitute for a tiling window manager. Note: Space seperated commands

  • C-p previous-window
  • C-n next-window
  • C-b send-prefix
  • C-b b last-window

##Pane Management

o  swap panes
q  show pane numbers
x  kill pane
⍽  space - toggle between layouts
  • C-b h and C-b C-h select pane on the left

  • C-b j and C-b C-j select pane below the current one

  • C-b k and C-b C-k select pane above

  • C-b l and C-b C-l select pane on the right

  • C-b + shift + h resize current pane 5 cells to the left

  • C-b + shift + j resize 5 cells in the up direction

  • C-b + shift + k resize 5 cells in the down direction

  • C-b + shift + l resize 5 cells to the right

  • C-b + | split current pane horizontally

  • C-b + - split current pane vertically

  • C-b + < moves current window one position to the left

  • C-b + > moves current window one position to the right

##Session management

  • C-b + g prompts for session name and switches to it. Performs 'kind-of' name completion. Faster than the built-in C-b + s prompt for long session lists.
  • C-b + C (shift + c) - prompt for creating a new session by name.
  • C-b + X (shift + x) - kill current session without detaching tmux.
  • C-b + S (shift + s) - switches to the last session. The same as built-in C-b + L that everyone seems to override with some other binding.
  • C-b + @ - promote current pane into a new session. Analogous to how C-b + ! breaks current pane to a new window.

##Tmux ressurect / Continum

  • C-b + Ctrl-r Restore Saves
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment