
set-option -sg escape-time 9

# switch panes using Alt-arrow without prefix
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

# open windows at current path
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"

set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'  # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'  # underscore colours - needs tmux-3.0

# Enable mouse mode (tmux 2.1 and above)
set -g mouse on

# only this line might not be enough
set -g default-terminal "tmux-256color"
# Needs this line also to overrides the default color
set-option -ga terminal-overrides ",xterm-256color:Tc"

# Github colors for Tmux

set -g mode-style "fg=#24292f,bg=colour255"

set -g message-style "fg=#24292f,bg=colour255"
set -g message-command-style "fg=#24292f,bg=colour255"

set -g pane-border-style "fg=#e1e4e8"
set -g pane-active-border-style "fg=#0366d6"

# status line
set -g status "on"
set -g status-justify "left"
set -g status-interval "5"
set-option -g status-position top

set -g status-style "fg=#0366d6,bg=colour255"

set -g status-left-style NONE
set -g status-right-style NONE

set -g status-left ''
set -g status-right '#[fg=colour233,bg=colour252,bold] #(uptime | rev | cut -d":" -f1 | rev | sed s/,//g) #[fg=colour233,bg=colour245,bold] %H:%M '

setw -g window-status-activity-style "underscore,fg=#586069,bg=colour255"
setw -g window-status-separator ""
setw -g window-status-style "NONE,fg=#ffffff,bg=colour255"
setw -g window-status-format "#[fg=#666666,bg=colour255,nobold,nounderscore,noitalics] #I: #W #F #[fg=colour255,bg=colour255,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#24292e,bg=#babbbd,bold] #I: #W #F #[fg=#babbbd,bg=colour255,nobold,nounderscore,noitalics]"


# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none

if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
