# Set terminfo
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",alacritty:Tc"

# set terminal title
set -g set-titles on

# boost history
set -g history-limit 10000

# allow terminal scrolling
set-option -ga terminal-overrides 'xterm*:smcup@:rmcup@'

# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

# split panes using | and -
bind _ split-window -h
bind - split-window -v
unbind '"'
unbind %

# reload config file
bind r source-file ~/.config/tmux/tmux.conf

# switch panes using Ctrl-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

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

# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1

# Renumber windows when they close
set-option -g renumber-windows on

#Statusbar stuff
set -g status 2
set -Fg status-format[1] '#{status-format[0]}'
set -g status-format[0] '#[fill=#2e3440]'
set -g status-justify "centre"
set -g status-left-style "none"
set -g message-command-style "fg=#88c0d0,bg=#2e3440"
set -g status-right-style "none"
set -g pane-active-border-style "fg=#88c0d0"
set -g status-style "none,bg=#2e3440"
set -g message-style "fg=#88c0d0,bg=#2e3440"
set -g pane-border-style "fg=#2e3440"
set -g status-right-length "100"
set -g status-left-length "100"
setw -g window-status-activity-style "fg=#88c0d0,bg=#2e3440"
setw -g window-status-separator ""
setw -g window-status-style "BOLD,fg=#88c0d0,bg=#2e3440"
set -g status-left ""
set -g status-right ""
setw -g window-status-format "#[fg=#4c566a,bg=#2e3440] #[fg=#242831,bg=#4c566a]#I #[fg=#e5e9f0,bg=#242831] #W#[fg=#242831,bg=#2e3440] "
setw -g window-status-current-format "#[fg=#81a1c1,bg=#2e3440] #[fg=#242831,bg=#81a1c1,BOLD]#I #[fg=#e5e9f0,bg=#242831,BOLD] #W#[fg=#242831,bg=#2e3440] "
