dotfiles/tmux/.config/tmux/tmux.conf

84 lines
2.9 KiB
Plaintext

#####################
# KEYBINDINGS #
#####################
# remap prefix from Ctrl+B to Ctrl+A
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# vi mode best mode
set -g mode-keys vi
# reload config file
bind r source-file ~/.config/tmux/tmux.conf \; display-message " ✱ tmux.conf is reloaded"
#####################
# BEHAVIOUR #
#####################
set -g allow-rename off # stop renaming windows automatically
set -g base-index 1 # start window numbering at 1
set -g pane-base-index 1 # keep pane numbering consistent with windows
set -g renumber-windows on # renumber windows when window closed
set -g mouse on # enable mouse mode
#####################
# VISUAL CHANGES #
#####################
# general
set -g status-position top # status bar at top
set -g status-style "fg=colour6,bg=black" # {fore,back}ground colours
set -g window-status-separator " " # status separator - space
set -g status-left "" # left status bar not used
set -g default-terminal "screen-256color"
set -ag terminal-overrides ",screen-256color:RGB"
# right status bar - prefix/copy status - iso8601 date + time
set -g status-right "#{prefix_highlight} #[fg=black,bg=colour6] %y-%m-%d #[bg=black] #[fg=black,bg=colour4] %H:%M "
# current window
set -g window-status-current-format "#[fg=black,bg=colour4] #I #[fg=colour4,bg=colour240,bold] #W "
# standard window
set -g window-status-format "#[fg=colour6,bg=colour238] #I #[fg=colour6,bg=colour238] #W "
# panes
set -g pane-active-border-style "fg=colour4,bg=colour236" # active pane style
set -g pane-border-style "fg=colour238,bg=colour236" # inactive pane style
# messages
set -g message-style "fg=black,bg=colour5"
# prefix highlight
set -g @prefix_highlight_fg black # highlight foreground
set -g @prefix_highlight_bg colour5 # highlight background
set -g @prefix_highlight_show_copy_mode on # show when in copy-mode
set -g @prefix_highlight_copy_mode_attr fg=black,bg=yellow # copy-mode bg/fg
#####################
#TMUX PLUGIN MANAGER#
#####################
# conform to XDG base directory specification
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.config/tmux/plugins'
# list of plugins
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-yank \
tmux-plugins/tmux-urlview \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-pain-control \
tmux-plugins/tmux-prefix-highlight \
'
# other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# install TPM if not already installed
if "test ! -d ~/.config/tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm'"
# initialise TPM (always keep at bottom of tmux.conf)
run ~/.config/tmux/plugins/tpm/tpm