set -g default-terminal "screen-256color"
set -g prefix C-z
unbind C-b
bind-key C-z send-prefix
unbind %
bind _ split-window -h
unbind '"'
bind - split-window -v
unbind r
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
bind -r Tab last-window # move to last active window
bind-key -n M-h previous-window # select previous window
bind-key -n M-l next-window # select next window
bind -r j resize-pane -D 5
bind -r k resize-pane -U 5
bind -r l resize-pane -R 5
bind -r h resize-pane -L 5
bind -r m resize-pane -Z
set -g mouse on
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection # start selecting text with "v"
bind-key -T copy-mode-vi 'y' send -X copy-selection # copy text with "y"
unbind -T copy-mode-vi MouseDragEnd1Pane # don't exit copy mode when dragging with mouse
# remove delay for exiting insert mode with ESC in Neovim
set -sg escape-time 10
# tpm plugin
set -g @plugin 'tmux-plugins/tpm'
# list of tmux plugins
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-resurrect' # persist tmux sessions after computer restart
set -g @plugin 'tmux-plugins/tmux-continuum' # automatically saves sessions for you every 15 minutes
set -g @plugin 'catppuccin/tmux'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'xamut/tmux-weather'
# set -g @plugin 'vascomfnunes/tmux-clima'
# set -g @plugin 'jamesoff/tmux-loadavg'
# ========= catppuccin/tmux configuration start =============
set -g @catppuccin_window_left_separator ""
set -g @catppuccin_window_right_separator " "
set -g @catppuccin_window_middle_separator " █"
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_left ""
set -g @catppuccin_status_modules_right "directory application weather date_time cpu session"
set -g @catppuccin_status_left_separator " "
set -g @catppuccin_status_right_separator ""
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_status_connect_separator "no"
set -g @catppuccin_directory_text "#{b:pane_current_path}"
# ========= catppuccin/tmux configuration end =============
set -g @resurrect-capture-pane-contents 'on'
set -g @continuum-restore 'on'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'