about | blog | config | notes | github


Tmux is a terminal multiplexer. I however mainly use it for its ability to create sessions in remote machines and it's ability to keep those sessions alive and running even after I have closed them from OpenSSH.

1. Configuration

1.1. Basic Config

Some sane defaults to use 256 color mode and setting the line buffer size.

set -g default-terminal "screen-256color"
set -g history-limit 100000

Start window indexing at one instead of zero.

set -g base-index 1

1.2. Keybindings

Set the prefix key and some key bindings to match GNU Screen.

set -g prefix C-b

Shortcut to jump back to the previously focused window.

#bind-key C-a last-window

Key bindings for creating horizontal and vertical panes.

unbind %
unbind '"'
bind | split-window -h
bind - split-window -v

Add vim-like bindings for focus movement

unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R

1.3. Window Settings

Display window titles and set the format string as well.

set -g set-titles on
set -g set-titles-string '#T'

1.4. Status Bar

Improvement the status bar aesthetic and also add cpu load and datetime info as well.

set -g status-bg '#4e4e4e'
set -g status-fg '#ffffff'
set -g status-left ' '
set -g status-right '#[bg=#bbbbbb]#[fg=#000000]#(cut -d " " -f -3 /proc/loadavg) #[bg=#4e4e4e]#[fg=#ffffff]#(date +" %H:%M ")'
set -g window-status-format '#I #W'
set -g window-status-current-format ' #I #W '
setw -g window-status-current-bg '#55ff55'
setw -g window-status-current-fg '#000000'

1.5. Pane

Customize colors of the panes.

set -g pane-active-border-fg '#bbbbbb'
set -g pane-border-fg '#555555'

1.6. Reload Config

Keybinding to quickly reload config.

bind r source-file ~/.tmux.conf

Created: 2021-11-13

Emacs 26.1 (Org mode 9.5)