# `tmux`
[Arch Wiki: tmux](https://wiki.archlinux.org/title/Tmux)
## Installation
````{tabs}
```{code-tab} bash {{ arch_based }}
sudo pacman -S tmux
```
```{code-tab} bash {{ debian_based }}
sudo apt install -y tmux
```
````
## Usage
[Tmux Cheat Sheet](https://tmuxcheatsheet.com/)
### Keyboard Shortcuts
By default, command key bindings are prefixed by {kbd}`Ctrl B`.
#### Session management
| Command | Shortcut |
| :-- | :-: |
| Detach from session | {kbd}`D` |
| Move to next session | {kbd}`(` |
| Move to previous session | {kbd}`)` |
| Rename session | {kbd}`$` |
| Session and Window Preview | {kbd}`W` |
#### Window management
| Command | Shortcut |
| :-- | :-: |
| Close current window | {kbd}`&` |
| Create window | {kbd}`C` |
| List windows | {kbd}`W` |
| Next window | {kbd}`N` |
| Previous window | {kbd}`P` |
| Rename current window | {kbd}`,` |
| Select window by number | {kbd}`0`...{kbd}`9` |
| Toggle last active window | {kbd}`L` |
#### Panes
| Command | Shortcut |
| :-- | :-: |
| Convert pane into a window | {kbd}`!` |
| Move the current pane left | {kbd}`{` |
| Move the current pane right | {kbd}`}` |
| Resize current pane | {kbd}`Ctrl B` + {kbd}`Up`
{kbd}`Ctrl B` + {kbd}`Down`
{kbd}`Ctrl B` + {kbd}`Left`
{kbd}`Ctrl B` + {kbd}`Right` |
| Show pane numbers | {kbd}`Q` |
| **Split the current pane with a horizontal line to create a vertical layout** | {kbd}`"` |
| **Split the current pane with a vertical line to create a horizontal layout** | {kbd}`%` |
| Switch to next pane | {kbd}`O` |
| **Switch to pane to the direction** | {kbd}`Up`
{kbd}`Left` {kbd}`Right`
{kbd}`Down` |
| Switch/select pane by number | {kbd}`q` {kbd}`0`...{kbd}`9` |
| Toggle last active pane | {kbd}`;` |
| Toggle pane zoom | {kbd}`Z` |