.dotfiles/tmux/.tmux.conf
2022-07-26 11:23:45 -04:00

97 lines
3.2 KiB
Plaintext

# easy reload config
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
# Window Splits
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# Start numbering at 1
set -g base-index 1
set-window-option -g pane-base-index 1
# Allows for faster key repetition
set -s escape-time 50
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# Activity monitoring
setw -g monitor-activity on
# auto window rename
set -g allow-rename on
set-option -g base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# How to get nice colors
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
# Yeah I use the mouse
set -g mouse on
# set prefix to Ctrl-Space
unbind C-b
set -g prefix C-Space
bind Space send-prefix
# Equalize all windows with x
bind x select-layout even-vertical
# Setup tmux key so that ctrl-VIM can move around panes
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"
# Status Line
set-option -g status-position bottom
set -g status-bg default
set -g status-fg default
set -g status-left-length 100
set -g status-right " #[fg=default]#W#[fg=red] >> #[fg=white] #{cpu_percentage} |  #{ram_percentage} #[fg=red]>> #[fg=white]%d/%m %H:%M "
set -g status-right-length 0
set -g status-left ""
set -g status-justify left
setw -g window-status-format '#[fg=white]#I #[fg=black]#W '
setw -g window-status-format '#[fg=white,bg=default]#[fg=black,bg=white]#I #[fg=black,bg=white]#W #[fg=white,bg=default]'
setw -g window-status-current-format '#[fg=magenta,bg=default]#[fg=black,bg=magenta]#I #[fg=black,bg=magenta]#W #[fg=magenta,bg=default]'
setw -g window-status-current-style fg=red
setw -g window-status-activity-style fg=yellow
setw -g window-status-bell-style fg=yellow
set -g set-titles on
# List of plugins
set -g @plugin 'tmux-plugins/tpm' # The plugin manager
set -g @plugin 'christoomey/vim-tmux-navigator' # Integrate vim navigation with tmux
set -g @plugin 'tmux-plugins/tmux-cpu' # CPU Data in the status bar
set -g @plugin 'ofirgall/tmux-window-name' # Window name in the status bar
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'