Skip to content

Instantly share code, notes, and snippets.

@spoulson
Forked from henrik/tmux_cheatsheet.markdown
Last active January 17, 2018 15:32
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 spoulson/89fe4c8eabd7c6fee9ada861a1b31731 to your computer and use it in GitHub Desktop.
Save spoulson/89fe4c8eabd7c6fee9ada861a1b31731 to your computer and use it in GitHub Desktop.
tmux cheatsheet

tmux cheatsheet

Start tmux

start new:

tmux

start new with session name:

tmux new -s myname

attach:

tmux a | at | attach

attach to named:

tmux a -t myname

list sessions:

tmux ls

kill session:

tmux kill-session -t myname

tmux Commands

Sessions

^B :new<CR>  new session
^B s         list sessions
^B $         name session

Windows (tabs)

^B c           new window
^B n|p         switch windows
^B ,           name window
^B w           list windows
^B f           find window
^B &           kill window
^B .           move window - prompted for a new number
^B :movew<CR>  move window to the next unused number

Panes (splits)

^B %        horizontal split
^B "        vertical split
^B h|j|k|l  switch panes
^B o        swap panes
^B q        show pane numbers
^B x        kill pane
^B ⍽        space - toggle between layouts:  
            even-vertical, even-horizontal, main-horizontal,
            main-vertical, tiled

Window/pane surgery

^B :joinp -s :2<CR>  move window 2 into a new pane in the current window
^B :joinp -t :1<CR>  move the current pane into a new pane in window 1

Misc

^B d  detach
^B t  big clock
^B ?  list shortcuts
^B :  tmux prompt

Resources:

Notes:

  • You can Cmd+click URLs to open in iTerm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment