2018-03-10 04:04:29 +00:00
|
|
|
# Rebind prefix to `
|
|
|
|
unbind C-b
|
|
|
|
set-option -g prefix `
|
|
|
|
bind-key ` send-prefix
|
|
|
|
# Rebind split to - and |
|
|
|
|
unbind '"'
|
|
|
|
unbind %
|
|
|
|
bind | split-window -h
|
|
|
|
bind - split-window -v
|
|
|
|
# Bind config reloading
|
2018-07-04 14:19:07 +00:00
|
|
|
bind r source-file ~/.tmux.conf \; display-message 'Config reloaded...'
|
|
|
|
|
|
|
|
# Escape delay is anoying in vim
|
|
|
|
set -s escape-time 0
|
|
|
|
|
|
|
|
# Smart pane switching with awareness of Vim splits.
|
|
|
|
# See: https://github.com/christoomey/vim-tmux-navigator
|
|
|
|
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
|
|
|
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
|
|
|
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
|
|
|
|
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
|
|
|
|
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
|
|
|
|
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
|
|
|
|
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
|
|
|
|
bind-key -T copy-mode-vi C-h select-pane -L
|
|
|
|
bind-key -T copy-mode-vi C-j select-pane -D
|
|
|
|
bind-key -T copy-mode-vi C-k select-pane -U
|
|
|
|
bind-key -T copy-mode-vi C-l select-pane -R
|
|
|
|
bind-key -T copy-mode-vi C-\ select-pane -l
|
2018-03-10 04:04:29 +00:00
|
|
|
|
|
|
|
# Mouse
|
|
|
|
set -g mouse on
|
|
|
|
|
2018-07-04 14:19:07 +00:00
|
|
|
# tmux-256-color is badly supported on some system, especially servers so we pretend to base screen instead
|
|
|
|
set -g default-terminal 'screen-256color'
|
|
|
|
set -ga terminal-overrides ',screen-256color:Tc'
|
2018-03-10 04:04:29 +00:00
|
|
|
|
|
|
|
# Window
|
|
|
|
set -g base-index 1
|
|
|
|
|
|
|
|
# Pane
|
|
|
|
setw -g pane-base-index 1
|
|
|
|
setw -g allow-rename off
|
2018-07-04 14:19:07 +00:00
|
|
|
set -g pane-border-fg 'colour7'
|
|
|
|
set -g pane-active-border-fg 'colour5'
|
2018-03-10 04:04:29 +00:00
|
|
|
|
|
|
|
# Status bar
|
|
|
|
set -g status-position top
|
2018-07-04 14:19:07 +00:00
|
|
|
set -g status-bg 'default'
|
2018-03-10 04:04:29 +00:00
|
|
|
|
2018-07-04 14:19:07 +00:00
|
|
|
setw -g window-status-fg 'colour7'
|
|
|
|
setw -g window-status-bg 'default'
|
|
|
|
setw -g window-status-format ' #I:#W'
|
2018-03-10 04:04:29 +00:00
|
|
|
|
2018-07-04 14:19:07 +00:00
|
|
|
setw -g window-status-current-fg 'colour15'
|
|
|
|
setw -g window-status-current-bg 'default'
|
|
|
|
setw -g window-status-current-format ' [#I:#W]'
|
2018-03-10 04:04:29 +00:00
|
|
|
|
|
|
|
setw -g window-status-activity-attr bold
|
|
|
|
|
2018-07-04 14:19:07 +00:00
|
|
|
set -g status-left-fg 'colour7'
|
2018-03-10 04:04:29 +00:00
|
|
|
set -g status-left '{#[fg=colour6]#S#[fg=default]}'
|
|
|
|
|
|
|
|
set -g status-right-length 100
|
2018-07-04 14:19:07 +00:00
|
|
|
set -g status-right-fg 'colour7'
|
2018-03-10 04:04:29 +00:00
|
|
|
set -g status-right '#(__tmux_status)'
|
|
|
|
|