2019-11-21 21:44:27 +01:00
|
|
|
# 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
|
2019-12-14 23:27:11 +01:00
|
|
|
set -g renumber-windows on # renumber windows when a window is closed
|
2019-11-21 21:44:27 +01:00
|
|
|
set-option -g set-titles on
|
|
|
|
set-option -g allow-rename on
|
|
|
|
|
|
|
|
set -g status-keys vi
|
2020-03-24 04:32:12 +01:00
|
|
|
set -g history-limit 1000000
|
2019-11-21 21:44:27 +01:00
|
|
|
|
|
|
|
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'
|
2019-12-14 23:27:11 +01:00
|
|
|
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle \; send-keys -X begin-selection
|
2019-12-10 01:05:02 +01:00
|
|
|
set -g @yank_selection 'primary' # or 'secondary' or 'clipboard'
|
|
|
|
set -g @yank_selection_mouse 'clipboard' # or 'primary' or 'secondary'
|
2019-12-14 23:27:11 +01:00
|
|
|
set -g @yank_action 'copy-pipe-and-cancel' # or 'copy-pipe-and-cancel' for the default
|
2019-11-21 21:44:27 +01:00
|
|
|
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
|
|
|
|
|
2019-12-14 23:27:11 +01:00
|
|
|
# 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
|
2019-11-21 21:44:27 +01:00
|
|
|
# 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:
|
2019-12-08 02:53:03 +01:00
|
|
|
set -g default-terminal "xterm-256color"
|
2019-11-21 21:44:27 +01:00
|
|
|
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
|
2019-12-14 23:27:11 +01:00
|
|
|
set -g status-interval 10 # redraw status line every n seconds
|
|
|
|
set -g status-left-length 70
|
|
|
|
set -g status-right-length 70
|
2019-12-08 02:53:03 +01:00
|
|
|
set -g status-left '#[fg=green,bold](#S) '# #(whoami) '
|
2019-12-14 23:27:11 +01:00
|
|
|
#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]'
|
2019-12-08 02:53:03 +01:00
|
|
|
|
|
|
|
# List of plugins
|
|
|
|
set -g @plugin 'tmux-plugins/tpm'
|
|
|
|
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
2019-12-10 01:05:02 +01:00
|
|
|
set -g @plugin 'tmux-plugins/tmux-yank'
|
2019-12-10 02:07:59 +01:00
|
|
|
set -g @plugin 'tmux-plugins/tmux-copycat'
|
2019-12-14 23:27:11 +01:00
|
|
|
set -g @plugin 'tmux-plugins/tmux-battery'
|
2019-12-08 02:53:03 +01:00
|
|
|
|
|
|
|
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'
|