dotfiles/.tmux.conf

192 lines
5.0 KiB
Plaintext

# tmux configuration
# Author: Kevin Hill
# Shamelessly ripped from Tim Visee
################################
# General configurations #
################################
# Start windows from 1, zero is too far away
set -g base-index 1
setw -g pane-base-index 1
# Automatic window naming
set-window-option -g automatic-rename off
set-option -g set-titles on
# Enable window activity notifications
# setw -g monitor-activity on
# set -g visual-activity on
# Put window listing on the left of the status bar
set -g status-justify left
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
#set -g default-terminal "xterm-256color"
#set -ga terminal-overrides ",*256color:Tc"
# Set the terminal mode, to properly support colors
# set -g default-terminal 'screen-256color'
# Set Truecolor if supported
# Enable RGB colour if running in xterm(1)
# set-option -sa terminal-overrides ",xterm*:Tc"
# Set the history limit
set -g history-limit 100000
# Display messages and pane numbers for 3 seconds, not 1
set-option -g display-time 3000
set -g display-panes-time 3000
# Minimize tmux escape time
set -sg escape-time 0
# Set repeat timeout, when switching panes with arrows
set -sg repeat-time 400
# Force the use of UTF-8 (suppressed, mostly not available)
set -gq utf8 on
set -g mouse on
################################
# Key bindings #
################################
# Enable xterm keys
setw -g xterm-keys on
# Use Vim keybindings
setw -g mode-keys vi
set -g status-keys vi
# Split bindings
bind-key v split-window -h
bind-key s split-window -v
# Pane selection bindings
bind j select-pane -D
bind k select-pane -U
bind h select-pane -L
bind l select-pane -R
# Pane selection bindings with alt
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-h select-pane -L
bind -n M-l select-pane -R
# Window selection bindings with alt and arrow
bind -n S-Left previous-window
bind -n S-Right next-window
# Pane resize bindings
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
bind-key L resize-pane -R 5
bind-key M-j resize-pane -D
bind-key M-k resize-pane -U
bind-key M-h resize-pane -L
bind-key M-l resize-pane -R
# Mouse mode
bind-key m set -g mouse on \; display 'Mouse -> ON'
bind-key M set -g mouse off \; display 'Mouse -> OFF'
# Copy and paste
#bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
# Reload tmux config
bind r source-file ~/.tmux.conf \; display 'tmux configuration reloaded'
################################
# Theming #
################################
# Status update interval
set -g status-interval 5
# Basic status bar colors
set -g status-style fg=colour08,bg=black
# Left side of status bar
set -g status-left-style fg=colour04,bg=black
set -g status-left-length 55
set -g status-left "#[fg=#292824,bg=#6684e1,bold] #S #[fg=#292824,bg=#6e6b5e,nobold] #(whoami) #[fg=#a6a28c,bg=#292824,nobold] #I:#P #[fg=colour3,bg=black,nobold] Restore: #{continuum_status}"
# Right side of status bar
set -g status-right-style fg=colour04,bg=black
set -g status-right-length 55
set -g status-right "#[fg=colour3,bg=black,nobold] Net: #{online_status} #[fg=#a6a28c,bg=#292824,nobold] #(cut -d ' ' -f 1-3 /proc/loadavg) #[fg=#292824,bg=#6e6b5e,nobold] %d-%m-%Y %H:%M #[fg=#292824,bg=#6684e1,bold] #H "
# Window status
set -g window-status-format "#I#W#F"
set -g window-status-current-format "#I#W#F"
# Current window status
set -g window-status-current-style fg=colour4,bg=black
# Window with activity status
set -g window-status-activity-style fg=colour04,bg=colour10
# Window separator
set -g window-status-separator " "
# Window status alignment
set -g status-justify centre
# Pane border
set -g pane-border-style fg=colour08,bg=default
# Active pane border
set -g pane-active-border-style fg=colour04,bg=default
# Pane number indicator
set -g display-panes-colour colour08
set -g display-panes-active-colour colour04
# Clock mode
set -g clock-mode-colour colour04
set -g clock-mode-style 24
# Message
set -g message-style fg=black,bg=colour04
# Command message
set -g message-command-style fg=black,bg=colour04
# Mode
set -g mode-style fg=black,bg=colour04
# tmux plugin manager
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-online-status'
# set -g @plugin 'tmux-plugins/tmux-cpu'
# Try to restore vim/nvim session on ressurect
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
# Turn on continuous restore
# set -g @continuum-restore 'on'
set -g @continuum-save-interval '5'
# When mouse-mode active, yank to clipboard instead of primary
set -g @yank_selection_mouse 'clipboard' # or 'primary' or 'secondary'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'