1.6. TMUX - Desktop¶
Tmux is Terminal MUlti-pleXer. It needs some custom settings to make it:
Easier to use
Look better
These are my “easier to use commands”:
Keys |
Meaning |
---|---|
tmux |
Start a terminal multiplexer session |
Alt-r |
Reload tmux.conf |
Alt-b |
Split horizontal |
Alt-v |
Split vertical |
Mouse click pane |
Move from one pane to another |
Alt-{h, j, k, l} |
Move from one pane to another {up, down, left, right} |
Alt-c |
Close pane |
Alt-w |
New window |
Alt-PAGEUP |
Previous window |
Alt-PAGEDOWN |
Next window |
Alt-e |
Kill window |
Alt-x |
Kill server |
Ctrl-a ctrl-r |
Resore session |
Ctrl-a ctrl-s |
Save session |
Hold shift and highlight |
Copy |
Hold shift and middle mouse |
Paste |
The configuration file implements this easier to use and look better requirements:
1.6.1. Edit config files¶
https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
override system /etc/tmux.conf with ~/.tmux.conf
1.6.2. Tmux conf¶
#########
# GENERAL
#########
# set prompt colours
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# remap prefix from 'control-b' to 'control-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# reload config file (control-a r)
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"
# reload config file (alt r)
bind -n M-r source-file ~/.tmux.conf \; display "Config Reloaded!"
#######
# PANES
#######
# horizontal and vertical pane splitting via meta
bind -n M-b split-window -h
bind -n M-v split-window -v
# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on
# vim-style pane movements
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-k select-pane -U
bind -n M-j select-pane -D
# close pane
bind -n M-c kill-pane
#########
# WINDOWS
#########
# new window
bind -n M-w new-window
# previous window
bind -n M-PAGEUP previous-window
# next window
bind -n M-PAGEDOWN next-window
# exit window
bind -n M-e kill-window
########
# SERVER
########
# kill server
bind -n M-x kill-server
#######
# THEME
#######
# theme
source-file "${HOME}/.tmux-themepack/powerline/double/green.tmuxtheme"
###########
# RESSURECT
###########
# ressurect
run-shell ~/Tmux/resurrect.tmux
# save session
set -g @resurrect-save 's'
# restore session
set -g @resurrect-restore 'a'
1.6.3. TMUX theme¶
git clone https://github.com/jimeh/tmux-themepack.git ~/.tmux-themepack
Change font color to 100 on line 32 of green,tmuxtheme
set -g window-status-current-format “#[fg=colour233,bg=black]#[fg=colour100,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]”
1.6.4. Powerline fonts¶
Most recent version of the symbol font:
copied powerline-symbols.ttf from laptop
Move the font to your fonts directory:
sudo mv powerline-symbols.ttf /usr/share/fonts/
Update system wide cache:
sudo fc-cache -vf /usr/share/fonts/
Now install the fontconfig file:
wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
Font config file:
sudo mv 10-powerline-symbols.conf /etc/fonts/conf.d/
1.6.5. TMUX Resurrect¶
git clone https://github.com/tmux-plugins/tmux-resurrect ~/Tmux
run-shell ~/Tmux/resurrect.tmux