set-environment -g PATH "/opt/homebrew/bin:/bin:/usr/bin"
set-window-option -g mode-keys vi
set-option default-terminal "screen-256color"
set-option default-terminal "tmux-256color"
set-option -a terminal-overrides ",*256col*:RGB"

# Set up Variables
black='#000000'
white='#f8f8f2'
gray='#44475a'
dark_gray='#282a36'
light_purple='#bd93f9'
dark_purple='#6272a4'
cyan='#8be9fd'
green='#50fa7b'
orange='#ffb86c'
red='#ff5555'
pink='#ff79c6'
yellow='#f1fa8c'
active='#50fa7b'
nonactive='#6272a4'
left_sep=''
right_sep=''

wanip="~/.dotfiles/tmux/.config/tmux/plugins/wan_ip.sh"
timezones="~/.dotfiles/tmux/.config/tmux/plugins/timezones.sh"
ifstat="~/.dotfiles/tmux/.config/tmux/plugins/ifstat.sh"


set -g status on
set -g status-interval 1
set -g status-justify centre

set-window-option -g window-status-separator ''
set-window-option -g window-status-current-format "#[fg=${active},bg=${dark_gray}]${right_sep}#[fg=${black},bg=${active}] #I #W #[fg=${active},bg=${dark_gray}]${left_sep}"
set-window-option -g window-status-format "#[fg=${white},bg=${dark_gray}] #I #W "
set-option -g status-bg ${dark_gray}
# set-option -g status-fg white
set -g status-left-length 50
# set -g status-left-style default
set -g status-left "#[fg=${black},bg=${light_purple}] #(${wanip}) #[fg=${light_purple},bg=${green}]${left_sep}#[fg=${black},bg=${green}] #(${ifstat})#[fg=${green},bg=${dark_gray}]${left_sep}"

set -g status-right-length 60
set -g status-right "#[fg=${pink},bg=${dark_gray}]${right_sep}#[fg=${black},bg=${pink}]#(${timezones}) "
set -g status-right-style default


# Standard Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'

# Continue Session on Startup
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'

# Search your Scrollback using fzf
# set -g @plugin 'roosta/tmux-fuzzback'


# Allow Focus Events
set -g focus-events on

# enable mouse support
set-option -g mouse on

# Open Pane in same working directory
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B)
set -g prefix C-b
unbind-key C-space
bind-key C-b send-prefix

# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"

# Vim-Tmux-Navigator plugin/
set -g @plugin 'christoomey/vim-tmux-navigator'

# Initialize TMUX plugin manager - kept at bottom of file
run '~/.dotfiles/tmux/.config/tmux/plugins/tpm/tpm'
