tmux new
- Create and attach to a new session.tmux new -s NAME_HERE
- Create and attach to a new session named NAME_HERE.CTRL-b, d
- Detach (i.e. exit) from the currently-opened tmux session (alternatively,tmux detach
). Note, this means press and holdCTRL
, pressb
, release both, pressd
.tmux ls
- Show list of tmux sessions.tmux a
- Attach to the previously-opened tmux session.tmux a -t NAME_HERE
- Attach to the tmux session named NAME_HERE.CTRL-d
- Delete (i.e. kill) currently-opened tmux session (alternativelytmux kill-session
).CTRL-b, [
- Enter copy mode, and enable scrolling in currently-opened tmux session. Pressq
to exit.CTRL-b, "
- Split window horizontally (i.e. split and add a pane below).CTRL-b, %
- Split window vertically (i.e. split and add a pane to the right).CTRL-b, UpArrow
- Move to the pane above (I prefer to rebind this toCTRL-b, k
to be similar to Vim).CTRL-b, DownArrow
- Move to the pane below (I prefer to rebind this toCTRL-b, j
to be similar to Vim).CTRL-b, LeftArrow
- Move to the pane to the left (I prefer to rebind this toCTRL-b, h
to be similar to Vim).CTRL-b, RightArrow
- Move to the pane to the right (I prefer to rebind this toCTRL-b, l
to be similar to Vim).CTRL-b, z
- Toggle maximization of current pane.CTRL-b, ESC, 2
- Resize all panes to equal size.CTRL-b, q
- Show pane numbers.CTRL-b, x
- Kill current pane.CTRL-b, c
- Create a new window.CTRL-b, n
- Switch to next window.CTRL-b, p
- Switch to previous window.CTRL-b, 3
- Switch to window 3.CTRL-b, CTRL-b, COMMAND
- Send the command to a nested tmux session (repeat prefix for each level of nesting).
Helpful guide: https://danielmiessler.com/study/tmux/#gs.KCjdzRc
Vim-Slime tmux integration (https://github.com/jpalardy/vim-slime)
- Connect to tmux session/window/pane for each Vim session:
- Leave tmux socket name set to
default
. - Target pane notes:
:
- current window, current pane (a reasonable default):i
- ith window, current pane:i.j
- ith window, jth paneh:i.j
- tmux sessionh
(either session name or number), the ith window, and the jth pane
- Leave tmux socket name set to
CTRL-c, CTRL-c
- Send either the explicitly selected text, or the current paragraph (i.e. results ofvip
).CTRL-c, v
- Reset the tmux connection settings.
- Start tmux with
tmux -CC
to enable native iTerm2 window management of the tmux session. Works for local tmux sessions, or sessions on remote machines.
tmux source-file ~/.tmux.conf
CTRL-b, :
to enter the command modecapture-pane -S -32768 ; save-buffer FILENAME_HERE
to save at least the last 32,768 lines from the buffer
nice