Tmux Configuration
tmux is one of the best tools you can use on a UNIX based system.
It’s a beefed up version of screen, a terminal multiplexer.
It’s mainly used trough ssh but i often use it locally as well.
Install
1 | sudo apt install tmux |
Tweaking
The basic tmux install can be configured an extended with plugins.
Some of the configuration is necessary to use tmux comfortably.
I’m sharing my .tmux.conf file as template.
This uses a sane keybinding layout and various plugins and tweaks.
You can try this as your .tmux.conf file after backing up yours.
The configuration file is located in ~/.tmux.conf.
You can install the plugins after tmux attach with Command + Shift + i.
1 | # scrollback size |
Plugins
- tpm plugin manager
- tmux sensible
- tmux resurrect - Save and restore session after reboot
- tmux-continuum - automatically save and restore tmux sessions
- tmux-yank - Advanced copy mode
Keybindings
Keybinding | Command |
---|---|
Ctrl + a | Command |
Command + t | New window |
Command + w | Kill pane |
Command + q | Kill session |
Command + r | Reload tmux config |
Command + z | Zoom to pane |
Command + $ | Rename session |
Command + , | Rename window |
Command + g | Split vertically |
Command + h | Split horizontally |
Command + ? | List keyboard shortcuts |
Command + : | Command prompt |
Command + s | List sessions |
Command + Ctrl + r | Reload session |
Command + Ctrl + s | Save session |
Command + Shift + i | Install plugins |
Copy and paste in mouse mode
Copy:
- Enter scroll mode with the mouse wheel.
- Select the text and press y.
- This copies the text into the clipboard.
- Exit scroll mode with escape.
Advanced copy:
- Enter scroll mode with the mouse wheel.
- Select the text and press Y.
- This copies the text into the terminal buffer and the clipboard.
- Exit scroll mode with escape.