# Tmux
See [tmux shortcuts & cheatsheet](https://gist.github.com/MohamedAlaa/2961058) for a good list of shortcuts.
## Installing
- Raspberry Pi
`sudo apt install tmux` ^glfch8
- MacOS (via Homebrew)
`brew install tmux`
Install the tmux plugin manager with
`git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm`
## Configuration
Tmux configuration is stored in the user directory under `.tmux.conf`.
```
# Turn on mouse support
set -g mouse on
# Turn on full color support
set -g default-terminal "screen-256color"
# Change the prefix to Ctrl+A
set -g prefix C-a
unbind C-b
bind-key C-a send-prefix
# Change the shortcuts for making vertical and horizontal splits
unbind %
bind | split-window -h
unbind '"'
bind - split-window -v
# Shortcut for maximizing a pane (restore again with m)
bind -r m resize-pane -Z
# Add Tmux Plugin Manager
set -g @plugin 'tmux-plugins/tpm'
# Auto clipboard copying, not needed on MacOS with iTerm2
set -g @plugin 'tmux-plugins/tmux-yank'
# Initialize the plugin manager (keep this at the bottom)
run '~/.tmux/plugins/tpm/tpm'
```
## Sources
- https://www.youtube.com/watch?v=U-omALWIBos