Since switching to vim, I’ve found myself really enjoying keyboard-based user interfaces. So instead of managing multiple terminal sessions in iTerm, I have started using tmux. I’m writing this cheat sheet as I learn. Check back often.

N.B. Keep in mind, everything in tmux is case sensitive.

Panes

commanddescription
ctrl-b %Split the current pane into 2 panes vertically
ctrl-b "Split the current pane into 2 panes horizontally
ctrl-b oSwitch to the “next” pane
ctrl-b arrowSwitch to the pane in the direction of arrow

Windows

commanddescription
ctrl-b cCreate a new window
ctrl-b nGo to the next window
ctrl-b pGo to the previous window
ctrl-b nSwitch to the window numbered n

Sessions

commanddescription
ctrl-b dDetach current session
tmux lsList all of the running sessions inside tmux
tmux attach -t n or tmux a -t nAttach to the session with the number n (-t stands for “target”)
tmux kill-session -t nKill the session with the number n. You shouldn’t need to do this very often; just exit out of the running processes, and tmux will quit itself