linuxbox/tmux.conf

60 lines
2.3 KiB
Bash

# Plugind
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'thewtex/tmux-mem-cpu-load'
set -g @plugin 'tmux-plugins/tmux-yank'
# Install `tpm` if needed.
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Activate the plugins.
run -b "~/.tmux/plugins/tpm/tpm"
set -g mouse on
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# VIM and FZF navigation bindings
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
is_fzf="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'"
bind -n C-h run "($is_vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "($is_vim && tmux send-keys C-j) || ($is_fzf && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "($is_vim && tmux send-keys C-k) || ($is_fzf && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "($is_vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n 'C-\' if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Split pane bindings
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
set-option -g status-position bottom
set-option -g default-terminal "screen-256color"
set-option -sa terminal-features ',xterm-256color:RGB'
set-option -sg escape-time 1
set-option -g focus-events on
set -g status-interval 2
set -g status-bg "#0c0c0c"
set -g status-fg "#6c6c6c"
set -g status-left ''
set -g status-right '#($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load -g 0 --interval 2) | %H:%M | %d-%b-%Y'
set -g status-right-length 100
# Use normal and bright monochrome colors to show a tab line on the left.
set -g status-justify left
set-window-option -g window-status-separator ''
set-window-option -g window-status-format '#[bg=#0c0c0c,fg=#6c6c6c] #I #W '
set-window-option -g window-status-current-format '#[bg=#0c0c0c,fg=#b0b0b0] #I #W '
# Switching panes should change the foreground color but not border colors.
set -g window-style 'bg=default,fg=#c6c6c6'
set -g window-active-style 'bg=default,fg=white'
set -g pane-border-style 'bg=default,fg=#0c0c0c'
set -g pane-active-border-style 'bg=default,fg=#afd787'