2022-03-18 14:34:27 +01:00
|
|
|
# Load machine-local config.
|
|
|
|
if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
|
|
|
|
|
|
|
|
# Make it use C-a, similar to screen.
|
|
|
|
unbind C-b
|
|
|
|
unbind l
|
|
|
|
set -g prefix C-a
|
|
|
|
bind-key a send-prefix # Send C-a.
|
|
|
|
bind-key C-a last-window
|
|
|
|
bind h splitw -h -p 50
|
|
|
|
bind v splitw -v -p 50
|
|
|
|
|
2022-10-22 04:42:20 +02:00
|
|
|
bind H split-window -h -l 71 # split into 120 and 71 columns
|
|
|
|
|
2022-03-18 14:34:27 +01:00
|
|
|
# Start window numbering at 1 for easier switching.
|
|
|
|
set -g base-index 1
|
|
|
|
|
|
|
|
# Do not start login shell.
|
|
|
|
set -g default-command "exec /bin/zsh"
|
|
|
|
|
|
|
|
# Enable Truecolor
|
2022-08-11 15:06:40 +02:00
|
|
|
set -ga terminal-overrides ",xterm*:RGB:Tc,rxvt-unicode*:RGB:Tc"
|
2022-05-09 03:09:26 +02:00
|
|
|
%if '#{>=:#{version},3.2}'
|
2022-08-11 15:31:47 +02:00
|
|
|
#set -sa terminal-features ",alacritty*:RGB"
|
2022-10-21 19:48:20 +02:00
|
|
|
set -ga terminal-overrides ",alacritty*:RGB"
|
2022-05-09 03:09:26 +02:00
|
|
|
%else
|
|
|
|
set -ga terminal-overrides ",alacritty*:Tc"
|
|
|
|
%endif
|
2022-10-21 19:48:20 +02:00
|
|
|
|
|
|
|
# underline style (different colour)
|
|
|
|
set-option -ga terminal-features ",alacritty:usstyle"
|
|
|
|
|
2022-03-18 14:34:27 +01:00
|
|
|
set -g default-terminal "tmux-256color"
|
|
|
|
|
|
|
|
# Make M-<up> and so on work in Emacs.
|
|
|
|
set -g xterm-keys on
|
|
|
|
|
|
|
|
set -g history-limit 10000
|
|
|
|
|
|
|
|
# Allow multiple commands without pressing the prefix-key again in milliseconds.
|
|
|
|
set -sg repeat-time 100
|
|
|
|
|
|
|
|
# Options for X-terminals.
|
|
|
|
set-option -g set-titles on
|
|
|
|
set-option -g set-titles-string "#T"
|
|
|
|
|
2022-03-18 22:33:12 +01:00
|
|
|
# Make text selection work
|
|
|
|
set -g mouse off
|
|
|
|
|
2022-08-11 15:06:40 +02:00
|
|
|
# Time in ms to check if it is part of a function / sequence. Lowered for nvim.
|
|
|
|
set -sg escape-time 10
|
|
|
|
|
|
|
|
# pass focus events to applications
|
|
|
|
set -g focus-events
|
|
|
|
|
2022-03-18 14:34:27 +01:00
|
|
|
# THEME
|
2022-05-09 02:52:46 +02:00
|
|
|
tmux_colour_status1="colour61" # violet
|
|
|
|
tmux_colour_status2="colour97" # dark pink
|
|
|
|
tmux_colour_inactive="colour237" # dark grey
|
2022-05-09 03:09:26 +02:00
|
|
|
# %hidden does not work with < 3.2, even if it's not accessible
|
2022-03-18 14:34:27 +01:00
|
|
|
|
|
|
|
# Status line
|
2022-05-09 02:52:46 +02:00
|
|
|
set -g status-style fg=${tmux_colour_status1}
|
2022-03-18 14:34:27 +01:00
|
|
|
set -g status-interval 10
|
|
|
|
set -g status-left-length 30
|
|
|
|
set -g status-left ''
|
2022-05-09 02:52:46 +02:00
|
|
|
set -g status-right "#[fg=${tmux_colour_inactive}]#(hostname --short)#[default] #[fg=${tmux_colour_status2}]#(cut -d ' ' -f 1-3 /proc/loadavg)#[default]"
|
2022-03-18 14:34:27 +01:00
|
|
|
|
|
|
|
# Window indicators.
|
2022-05-09 02:52:46 +02:00
|
|
|
set-window-option -g window-status-style fg=${tmux_colour_status1}
|
|
|
|
set-window-option -g window-status-current-style fg=black,bg=${tmux_colour_status1}
|
2022-03-18 14:34:27 +01:00
|
|
|
|
|
|
|
# Window borders.
|
2022-05-09 02:52:46 +02:00
|
|
|
set-option -g pane-border-style fg=${tmux_colour_inactive}
|
|
|
|
set-option -g pane-active-border-style fg=${tmux_colour_status1}
|