dotfiles/.tmux.conf

73 lines
2.7 KiB
Bash

# tmux config
# largely based on spicycode's config: https://gist.github.com/spicycode/1229612
set -g base-index 1
set-window-option -g automatic-rename on
set -g renumber-windows on # renumber windows when a window is closed
set-option -g set-titles on
set-option -g allow-rename on
set -g status-keys vi
set -g history-limit 1000000
setw -g mouse on
setw -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -sel clip -i'
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle \; send-keys -X begin-selection
set -g @yank_selection 'primary' # or 'secondary' or 'clipboard'
set -g @yank_selection_mouse 'clipboard' # or 'primary' or 'secondary'
set -g @yank_action 'copy-pipe-and-cancel' # or 'copy-pipe-and-cancel' for the default
setw -g monitor-activity on
bind-key v split-window -h
bind-key s split-window -v
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# No delay for escape key press
set -sg escape-time 0
# 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
# Reload tmux config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# Colors
# How to use true colors in vim under tmux? #1246 for 2.6 and higher
# https://github.com/tmux/tmux/issues/1246:
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",*256col*:Tc"
# THEME
set -g status-bg black
set -g status-fg white
#setw -g status-style default
setw -g status-bg colour237
setw -g status-fg colour39
set -g status-interval 10 # redraw status line every n seconds
set -g status-left-length 70
set -g status-right-length 70
set -g status-left '#[fg=green,bold](#S) '# #(whoami) '
#set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%a %H:%M#[default]'
set -g status-right '#{battery_status_bg} #{battery_percentage} #{battery_remain} #[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[fg=white] %a %H:%M #[default]'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-battery'
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'