
set  -g default-terminal "screen-256color"
set  -g base-index      1
setw -g pane-base-index 1

set -g status-keys vi
set -g mode-keys   vi

# rebind main key: C-g
unbind C-b
set -g prefix C-g
bind -N "Send the prefix key through to the application" \
  C-g send-prefix

set  -g mouse             on
setw -g aggressive-resize off
setw -g clock-mode-style  12
set  -s escape-time       500
set  -g history-limit     2000

set -sg terminal-overrides ",*:RGB"

set -g renumber-windows on

# Split panes
bind -T prefix / split-window -v -c "#{pane_current_path}"
bind -T prefix \\ split-window -h -c "#{pane_current_path}"

# Panes
bind 'h' select-pane -L # move left after prefix
bind 'j' select-pane -D # move down after prefix
bind 'k' select-pane -U # move up after prefix
bind 'l' select-pane -R # move right after prefix

# Conflicts with neovim
# bind -n 'C-h' select-pane -L # move left
# bind -n 'C-j' select-pane -D # move down
# bind -n 'C-k' select-pane -U # move up
# bind -n 'C-l' select-pane -R # move right

# bind -r 'S-h' resize-pane -L 5
# bind -r 'S-j' resize-pane -D 5
# bind -r 'S-k' resize-pane -U 5
# bind -r 'S-l' resize-pane -R 5

bind '<' swap-pane -D # swap current pane with the next one
bind '>' swap-pane -U # swap current pane with the previous one

# Windows
bind 'C-h' previous-window # select previous window
bind 'C-l' next-window # select next window
bind 'Tab' last-window # select last window

bind 'c' new-window -c "${pane_current_path}" # new window

# Theme
set -g @catppuccin_window_number_position "right"

set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_default_text "#W"

set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_current_text "#W"

set -g @catppuccin_status_modules_right "directory user host session"
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_status_connect_separator "no"

set -g @catppuccin_directory_text "#{pane_current_path}"

set -g @resurrect-strategy-nvim 'session'

set-option -g mouse on

set -g @continuum-restore 'on'

