blog.rk0.eu

tmux

Motivation

I like using tmux. It’s a terminal multiplexer, so it allows you to spawn multiple panes - and many more features.

the main features i use are:

  • Multiple panes
  • Different windows for different tasks
  • Reconnection to the tmux session after closing the terminal

If you want to learn more about tmux - read the official wiki

TPM

TPM is a plugin manager you can use it to import other tmux “plugins” into your configuration and configure them with some custom options.

But I dont like that because of the following reasons:

  • I want all my settings in one place and use basic tmux config settings, not magic plugin-options
  • My config should not depend on other packages on github
  • I don’t need complex plugins and everything i want to do can be done in a basic config

So i don’t use it.

My config

This is my current setup (i added some comments to make things a little bit clearer)

$HOME/.config/tmux/tmux.conf

# remap prefix from 'C-b' to 'C-a'
# Pretty usefull for nested sessions to have another tmux inside tmux
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

# Hotkey to reload + send a short notification so i know it worked
bind r source-file ~/.config/tmux/tmux.conf; display-message "Config reloaded!"

# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on

# i don't really work with window names yet,
# so i just stick with the auto names
set-option -g allow-rename off

# Start windows and panes at 1, not 0
# the first button im my keyboard number row is 1, not 0
set -g base-index 1
setw -g pane-base-index 1

# ? idk
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none

# clock mode (Prefix+t) ... If i need a fullscrean clock
setw -g clock-mode-colour yellow

# copy mode (FG is the font-color (i think it stands for foreground-color), BG the background color)
setw -g mode-style 'fg=black bg=red bold'

# panes
## highlight the current pane with red borders, and the others yellow
set -g pane-border-style 'fg=yellow'
set -g pane-active-border-style 'fg=red'

# statusbar
set -g status-position top
set -g status-justify left
set -g status-style 'fg=yellow'
set -g status-left ''
set -g status-left-length 0
set -g status on


# just a little bit darker than my terminal background color
# sorry for hardcoding a color :(
set -g status-bg "#232634"

# Window settings in the top-bar
setw -g window-status-style 'fg=yellow bg=black'
setw -g window-status-format ' #I #[fg=white]#W #[fg=yellow]#F '
setw -g window-status-bell-style 'fg=blue bg=red bold'

setw -g window-status-current-style 'fg=black bg=yellow'
setw -g window-status-current-format ' #I #W #F '

# Notification / Message Settings (like for the reaload notifciation)
set -g message-style 'fg=black bg=red bold'

# the right menu is basicly disabled, i dont need it
set -g status-right-style 'fg=white bg=black'
#set -g status-right ' %Y-%m-%d %H:%M '
set -g status-right ''
set -g status-right-length 60


# Binds a prefixless paneswich with vim bindings
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R