############################
# _____ __  __ _   ___  __
# |_   _|  \/  | | | \ \/ /
#   | | | |\/| | | | |\  / 
#   | | | |  | | |_| |/  \ 
#   |_| |_|  |_|\___//_/\_\
#	                            
#############################

# Defini le shell par defaut lance par tmux
set-option -g default-shell "/bin/zsh"

#set -g default-command "reattach-to-user-namespace -l zsh"
# tmux display things in 256 colors
set -g default-terminal "tmux-256color"
# set-option -sa terminal-overrides ',rxvt-color:RGB'

# Meme hack que sur screen lorsqu'on veut profiter du scroll du terminal (xterm ...)
set -g terminal-overrides 'xterm*:smcup@:rmcup@'

# Defini les notifications dans les fenetres
setw -g monitor-activity on
set -g visual-activity on

# Renommage automatique des fenetres
setw -g automatic-rename

# Peut etre utile...
#set -g status-utf8 on

# On permet l'utilisation de la souris pour changer de terminal et de panel
set -g mouse on

# Défilement
set -g terminal-overrides 'xterm*:smcup@:rmcup@'

# Resizing
setw -g aggressive-resize on

# Short escape time while running nvim with tmux
set-option -sg escape-time 100


### Binding personnalise
unbind %
set -g prefix C-a
bind C-a send-prefix
bind | split-window -h
bind - split-window -v
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# bind \" command-prompt -I "#W" "rename-window -- '%%'"


### Bar des statuts
# intervalle d'autoreload
set -g status-interval 2
set-option -g set-titles on


### Numerotation a partir de 1 pour faciliter l'acces
set -g base-index 1
set-window-option -g pane-base-index 1


### Theme
# Mode
set-option -g mode-style bg=brightblack,fg=default

# Status position
set-option -g status-position bottom

# Status update interval
set-option -g status-interval 5

# Basic status bar colors
set-option -g status-style bg=default,fg=white

# Left side of status bar
set-option -g status-left-length 40
set-option -g status-left "#[fg=brightwhite,bg=brightblack] #S #[fg=default,bg=default] "

# Window status
#set-option -g status-justify center
set-option -g window-status-format "#[fg=white,bg=brightblack] #I #[fg=white,bg=#363636] #W "
set-option -g window-status-current-format "#[fg=brightwhite,bg=green] #I #[fg=brightwhite,bg=blue] #W "
set-option -g window-status-separator " "

# Right side of status bar
set-option -g status-right-length 40
set-option -g status-right " #[fg=brightwhite,bg=#363636] %a %d %b %H:%M #[fg=brightwhite,bg=brightblack] #(whoami)@#h "

# Pane border
set-option -g pane-border-style bg=default,fg=brightblack
set-option -g pane-active-border-style bg=default,fg=white

# Pane number indicator
set-option -g display-panes-colour brightblack
set-option -g display-panes-active-colour brightwhite

# Clock mode
set-option -g clock-mode-colour white
set-option -g clock-mode-style 24

# Message
set-option -g message-style bg=default,fg=red

# source la config de vim
if-shell "test -f ~/.vim/tmuxline.conf" "source ~/.vim/tmuxline.conf"