Skip to content

Instantly share code, notes, and snippets.

@ian-bartholomew
Last active April 7, 2019 20:19
Show Gist options
  • Save ian-bartholomew/a9a69f3273c2d38ad23aa316b86bfe85 to your computer and use it in GitHub Desktop.
Save ian-bartholomew/a9a69f3273c2d38ad23aa316b86bfe85 to your computer and use it in GitHub Desktop.
Tmux Cheat Sheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Basic

start new:

 tmux

start new session with name:

tmux new -s <name>

attach:

tmux a  #  (or at, or attach)

attach to named:

tmux a -t myname

list sessions:

tmux ls

scroll in window

C-a [ then arrow keys

Sessions

:new<CR>  new session
s  list sessions
$  name session
,  rename session
(  prev session
)  next session

Panes

%  vertical split
"  horizontal split

o  swap panes
q  show pane numbers
x  kill pane
+  break pane into window (e.g. to select text by mouse to copy)
-  restore pane from window
⍽  space - toggle between layouts
<prefix> q (Show pane numbers, when the numbers show up type the key to goto that pane)
<prefix> { (Move the current pane left)
<prefix> } (Move the current pane right)
<prefix> z toggle pane zoom

Windows

C-a c          create a new window
C-a 1 ...      switch to window 1, ..., 9, 0
C-a 9
C-a 0
C-a p          previous window
C-a n          next window
C-a l          ‘last’ (previously used) window
C-a w          choose window from a list
C-a ,          rename the current window
C-a &          kill the current window
move-window    move window to first available slot

Misc

d  detach
t  big clock
?  list shortcuts
:  prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment