- In the official tmux documentation (
man tmux
), keyC
is Ctrl andM
is Alt. - Complete Getting Started Guide
These are run in the terminal outside tmux
Command | Description |
---|---|
tmux |
Starts a tmux session |
tmux new -s <SESSION NAME> |
Starts a named tmux session |
tmux ls |
List all active tmux sessions |
tmux kill -session -t <SESSION NAME> |
Kill a tmux session |
tmux attach <SESSION NUMBER> |
Attach to session using session number |
tmux attach -t <SESSION NAME> |
Attach to a session using session name |
Shortcut | Description |
---|---|
CTRL + B ? |
Show all tmux shortcuts |
CTRL + B w |
Navigate / browse tmux sessions and windows |
CTRL + B d |
Detach from current session |
Shortcut | Description |
---|---|
CTRL + B + <ARROW KEY> |
Resize currently active pane |
CTRL + B <ARROW KEY> |
Switch active pane |
CTRL + B % |
Split current pane vertically |
CTRL + B " |
Split current pane horizontally |
CTRL + B SPACEBAR |
Switch current pane orientation |
CTRL + B z |
Full screen a pane |
Shortcut | Description |
---|---|
CTRL + B c |
Create new window |
tmux rename-window <NAME> |
Rename the current window |
CTRL + B w |
List and choose specific window and pane |
CTRL + B , |
Go to named window |
CTRL + B n |
Go to next window |
CTRL + B p |
Go to previous window |
Shortcut | Description |
---|---|
CTRL + B [ |
Enter copy mode |
CTRL + SPACEBAR |
Select text in copy mode |
ALT + W |
Confirm text selection in copy mode (Will exit copy mode) |
CTRL + c |
Exit copy mode |
CTRL + B ] |
Paste copied text |
These commands can be run within tmux
Shortcut | Description |
---|---|
tmux rename-session |
Rename current session |
tmux rename-window |
Rename current window |
tmux swap-window -s <WIN INDEX> -t <WIN INDEX> |
Swap window positions |
tmux move-window -s <SES>:<WIN> -t <SES>:<WIN> |
Move a window to another session |
tmux move-pane -s <SES>:<WIN> -t <SES>:<WIN> |
Move a pane to another window |
-
Add
tmux
configuration file.tmux.conf
to home directory (ie.~/.tmux.conf
) -
Install Tmux Package manager
- Run in terminal:
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
- Add at END of
.tmux.conf
:set -g @plugin 'tmux-plugins/tpm'
run '~/.tmux/plugins/tpm/tpm'
- Run in terminal:
-
Add plugins into configuration file
- Example:
set -g @plugin 'tmux-plugins/tmux-resurrect'
(Adding tmux-resurrect plugin) - Example:
set -g @plugin 'tmux-plugins/tmux-yank'
(Adding tmux-yank plugin)
- Example:
-
Add configurations
- Example:
set -g mouse on
(Turn on mouse mode)
- Example:
-
After changing
tmux.conf
, still intmux
pressCTRL + B I
to refresh and install