set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
set-option -g default-command bash
set-option -g prefix C-w

bind-key -T copy-mode-vi 'C-c' send -X copy-pipe-and-cancel 'xclip -sel clip -i'

bind v split-window -c "#{pane_current_path}"
bind w split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"

bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10

bind-key T swap-window -t -1
bind-key t swap-window -t 1

bind-key -r f run-shell "tmux neww ~/bin/tmux-sessionizer.sh"
bind-key -r e run-shell "tmux neww sh ~/bin/tmux-sessionizer.sh -E"
# bind f send-keys -t.- 'sh ~/bin/tmux-sessionizer.sh' Enter

set -g mode-keys vi

set -g status-style bg=default
set -g status-fg white
set-option -g status-right ""

## COLORSCHEME: gruvbox dark (medium)
set-option -g status "on"

# default statusbar color
set-option -g status-style bg=black,fg=black # bg=bg1, fg=fg1
set-window-option -g window-status-current-style bg=white,fg=black # fg=bg1
set -g status-left-length 60

# set-option -g status-left "#[bg=colour241,fg=colour248] #S #[bg=black,fg=colour241,nobold,noitalics,nounderscore]"
# set-option -g status-right "#[bg=black,fg=colour239 nobold, nounderscore, noitalics]#[bg=colour239,fg=colour246] %Y-%m-%d  %H:%M #[bg=colour239,fg=colour248,nobold,noitalics,nounderscore]#[bg=colour248,fg=colour237] #h "
# set-window-option -g window-status-current-format "#[bg=green,fg=black,nobold,noitalics,nounderscore]#[bg=green,fg=black] #I #[bg=green,fg=black,bold] #W#{?window_zoomed_flag,*Z,} #[bg=black,fg=green,nobold,noitalics,nounderscore]"
# set-window-option -g window-status-format "#[bg=white,fg=black,noitalics]#[bg=white,fg=black] #I #[bg=white,fg=black,bold] #W #[bg=black,fg=white,noitalics]"

# index
set -g base-index 1
setw -g pane-base-index 1
bind-key s choose-tree -ZsK '#{?#{e|<:#{line},9},#{e|+:1,#{line}},#{?#{e|<:#{line},35},M-#{a:#{e|+:97,#{e|-:#{line},9}}},}}'
