darkcloud-tmuxconfig/tmux.normal.conf

178 lines
7.2 KiB
Text

#
# DARKCLOUD TMUX CONFIG: tmux.conf
#
# Maintainer: Kevin MacMartin (prurigro-at-gmail-dot-com)
# Website: https://github.com/prurigro/darkcloud-tmuxconfig
#
# License: MIT
#
# Notes:
#
# The status bar shows traffic for the eth0 network device by default.
# To use a different device, set $NETDEV to it's device name (eg: wlan0).
#
# PRECONFIG
#
# unbind the command prefix and set the new one to ctrl-Space
unbind C-b
set-option -g prefix C-Space
bind Space send-prefix
# SETTINGS
#
# general
set-option -g default-terminal "tmux-256color" # set $TERM variable so programs know how to behave
set-option -ag terminal-overrides ",alacritty:RGB,xterm-256color:RGB,gnome*:RGB" # enable truecolor where supported
set-option -g base-index 1 # start counting windows at 1 instead of 0 (for more logical keyboard-switching)
set-option -g pane-base-index 1 # start counting panes at 1 instead of 0
set-option -g renumber-windows on # when a window is closed, renumber the remaining windows
set-option -g set-titles on # attempt to set the terminal title
set-option -g set-titles-string "#I:#P - #W - #T" # string used to set the terminal title
set-option -g history-limit 100000 # maximum number of lines kept in history
set-option -g display-time 2000 # number of ms for status line messages and other on-screen indicators to display
set-option -g display-panes-time 2000 # number of ms to show indicators from the display-panes command
set-option -sg escape-time 0 # allow commands immediately following send-prefix
set-option -sg repeat-time 600 # allow 600ms between repeatable commands
set-option -g focus-events on
set-window-option -g aggressive-resize on # only resize a window if a smaller client is actively looking
set-window-option -g monitor-activity on # monitor for activity in windows
set-window-option -g visual-activity off # show the activity being monitored for in the status bar
set-window-option -g xterm-keys on # generate xterm-style function key sequences for better compatibility
set-window-option -g mode-keys vi # use vi-style keys in copy and choice modes
#
# clipboard (sync with the system)
set -s set-clipboard external
#
# mouse
set-option -g mouse on
bind -T root MouseDown3Pane send-keys -M # send right clicks to the application below
# KEY BINDINGS
#
# c to create a new window in ~ and <ctrl>c to create a new window in the path of the current pane
bind C-c new-window -c "#{pane_current_path}"
bind c new-window
#
# [ to create a new pane to the right and ] to create a new pane below
bind [ split-window -v -c "#{pane_current_path}"
bind ] split-window -h -c "#{pane_current_path}"
#
# - to evenly stack panes top-to-bottom and = to evenly place panes left-to-right
bind - select-layout even-vertical
bind = select-layout even-horizontal
#
# _ and + to rotate the panes clockwise and counter-clockwise
bind -r _ rotate-window -U
bind -r + rotate-window -D
#
# S to run the swap-pane command
bind S swap-pane
#
# , to swap the current window with another
bind , command-prompt "swap-window -d -t '%%'"
#
# # to rename the current window
bind "#" command-prompt -I '#W' "rename-window '%%'"
#
# Space and <ctrl><space> to navigating to the previously selected window and pane
bind Space last-window
bind C-Space last-pane
#
# ` to synchronize panes
bind ` set-window-option synchronize-panes \; display "synchronize-panes: toggled"
#
# r to reload /etc/tmux.conf and R to reload ~/.tmux.conf
bind r source-file /etc/tmux.conf \; display "system configuration reloaded"
bind R source-file ~/.config/tmux/tmux.conf \; display "local configuration reloaded"
#
# F1 and F2 to show the list of commands and keyboard bindings
bind F1 list-commands
bind F2 list-keys
#
# W to save scrollback to file
bind-key W command-prompt -p 'write scrollback to file:' -I '~/' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'
#
# V to enter copy mode
bind V copy-mode
#
# <ctrl>p paste the copy buffer
bind C-p paste-buffer
#
# rebind up,down,left and right to the same without repeat
bind Up select-pane -U
bind Down select-pane -D
bind Left select-pane -L
bind Right select-pane -R
#
# P and N to navigate to the previous and next session
bind P switch-client -p
bind N switch-client -n
#
# (without prefix) <alt> + up,down,left and right to navigate between panes
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
#
# (without prefix) <ctrl><alt> + up,down,left and right to swap the pane with the one in that direction
bind -n C-M-Up swap-pane -s '{up-of}'
bind -n C-M-Down swap-pane -s '{down-of}'
bind -n C-M-Left swap-pane -s '{left-of}'
bind -n C-M-Right swap-pane -s '{right-of}'
#
# (without prefix) <alt> + N and P to move to the next and previous windows
bind -n M-n next-window
bind -n M-p previous-window
#
# (without prefix) <ctrl><alt> + N and P to swap with the next and previous windows
bind -n C-M-n swap-window -d -t +
bind -n C-M-p swap-window -d -t -
#
# (without prefix) <alt>[0-9] to switch directly to the window with the respective index
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
bind -n M-0 select-window -t 10
#
# (without prefix) <alt>? to start searching
bind -n M-? copy-mode \; send-key ?
#
# (copy mode) v,y and escape to select, copy and cancel
bind -Tcopy-mode-vi v send -X begin-selection
bind -Tcopy-mode-vi y send -X copy-selection
bind -Tcopy-mode-vi Escape send -X cancel
# STATUS LINE
#
# settings
set-option -g status on # enable the status bar
set-option -g status-interval 2 # the number of seconds to wait before refreshing
set-option -g status-justify left # justify the window list on the left
set-option -g status-left-length '100' # the width in characters of the left side of the status line
set-option -g status-right-length '100' # the width in characters of the right side of the status line
set-window-option -g window-status-separator '' # the character with which to separate entries of the status line
#
# general theme
set-option -g status-style bg=colour236
set-option -g message-style bg=colour235,fg=colour254,bold
set-option -g message-command-style fg=colour253,bg=colour235
set-window-option -g pane-border-style fg=colour235
set-window-option -g pane-active-border-style fg=colour255
set-window-option -g window-status-style fg=colour255,bg=colour236
set-window-option -g window-status-activity-style fg=colour222,bold
set-window-option -g window-status-bell-style fg=colour222,bold
#
# theme for active and inactive window titles respectively
set-window-option -g window-status-format '#[fg=colour255,bg=colour236] #I #[fg=colour117,bg=colour236,nobold,nounderscore,noitalics]|#[fg=colour255,bg=colour236] #W '
set-window-option -g window-status-current-format ' #I #[fg=colour167,bg=colour235,bold,nounderscore,noitalics]|#[fg=colour253,bg=colour235,bold] #W '
#
# theme for the left and right sides respectively
set-option -g status-left '#[fg=colour117,bg=colour235,bold] #S '
set-option -g status-right '#[fg=colour222,bg=colour235] #([[ -n "$NETDEV" ]] && bwrate $NETDEV || bwrate eth0) #[fg=colour117,bg=colour236] %H:%M %Y-%m-%d #[fg=colour167,bg=colour235] #h '