# set default terminal
#set -ga terminal-overrides ",xterm-kitty:Tc,alacritty:Tc,xterm-termite:Tc"
set-option -g default-terminal "tmux-256color"
set-option -sa terminal-overrides ',xterm-256color:RGB,alacritty:RGB'
# set mouse/history stuff
set -g mouse on
set -g history-limit 20000

# rebind prefix
set -g prefix C-a
bind C-a send-prefix

# always renumber windows
set -g renumber-windows on

# tile all windows
unbind =
bind = select-layout tiled

# make window/pane index start with 1
set -g base-index 1
setw -g pane-base-index 1

# Set titles
set-option -g set-titles on
set-option -g set-titles-string "#T - #W"

# Set status bar
set -g status-bg black
set -g status-fg white
######################
#### Key Bindings ####
######################

# Unbind Arrow keys
unbind Up
unbind Down
unbind Left
unbind Right
unbind C-Up
unbind C-Down
unbind C-Left
unbind C-Right

# synchronize all panes in window
bind y setw synchronize-panes

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

# Resize-panes
bind Right resize-pane -R 10
bind Left resize-pane -L 10
bind Up resize-pane -U 10
bind Down resize-pane -D 10

# Move windows options
bind C-h previous-window
bind C-l next-window

# vim-like copy-mode
setw -g mode-keys vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -Tcopy-mode-vi 'v' send -X begin-selection
bind -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"

# split-windows
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"


set -s escape-time 0