# 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
bind r source-file ~/.tmux.conf \; display-message 'Config reloaded...'

# Escape delay is anoying in vim
set -s escape-time 0

# Mouse
set -g mouse on

# Window
set -g base-index 1

# Pane
setw -g pane-base-index 1
setw -g allow-rename off
set -g pane-border-style fg='colour7'
set -g pane-active-border-style fg='colour5'

# Status bar
set -g status-position top
set -g status-bg 'default'

setw -g window-status-style fg='colour7'
setw -g window-status-format ' #I:#W'
setw -g window-status-current-style fg='colour15'
setw -g window-status-current-format ' [#I:#W]'

setw -g window-status-activity-style bold

set -g status-left-style fg='colour7'
set -g status-left '{#[fg=colour6]#S#[fg=colour7]}'

set -g status-right-length 100
set -g status-right-style fg='colour7'
set -g status-right '#U@#H'

# Plugins
# Resurect pane content
set -g @resurrect-capture-pane-contents 'on'

# Also resurect the vim session
set -g @resurrect-strategy-vim 'session' # for vim
set -g @resurrect-strategy-nvim 'session' # for neovim
# additional process to restore
set -g @resurrect-processes 'ssh watch'

# Save every 5 minutes
set -g @continuum-save-interval '5'

# Restore on session start
#set -g @continuum-restore 'on'

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'soyuka/tmux-current-pane-hostname'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
#set -g @plugin 'git@github.com:badjware/tmux-continuum.git'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
# prefix + I : install
# prefix + U : update
# prefix + alt + u : cleanup
run -b '~/.tmux/plugins/tpm/tpm'
