# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
bind C-a send-prefix
unbind C-b

# split panes using | and -
bind \\ split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %

#killall panes except currnet
#bind k kill-pane -a

# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf

######################
### DESIGN CHANGES ###
######################

# panes
set -g pane-border-style fg=black
set -g pane-active-border-style fg=brightred

## Status bar design
# status line
#set -g status-utf8 on
set -g status-justify left
set -g status-bg default
set -g status-fg colour12
set -g status-interval 2

# messaging
set -g message-style fg=black,bg=yellow
set -g message-command-style fg=blue,bg=black

#window mode
setw -g mode-style bg=colour6,fg=colour0

# window status
setw -g window-status-format " #F#I:#W#F "
setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
setw -g window-status-current-style bg=colour0,fg=colour11
#,attr=dim
setw -g window-status-style bg=green,fg=black

# Info on left (I don't have a session display for now)
set -g status-left ''

# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none

set -g default-terminal "screen-256color"

# The modes {
setw -g clock-mode-colour colour135
#setw -g mode-style attr=bold
setw -g mode-style fg=colour196,bg=colour238
# 12 hour clock
setw -g clock-mode-style 12

# }
# The panes {

set -g pane-border-style bg=colour235
set -g pane-border-style fg=colour238
set -g pane-active-border-style bg=colour236
set -g pane-active-border-style fg=colour51

# }
# The statusbar {

set -g status-position bottom
set -g status-style bg=colour234,fg=colour137
set -g status-left ''
#set -g status-right '#([ $(cat /sys/class/power_supply/AC/online) = 0 ] && echo 🔋 || echo 🔌) #(acpi | cut -d\  -f4|tr -d ",") #[fg=colour233,bg=colour241,bold] %m/%d #[fg=colour233,bg=colour245,bold] %I:%M '
set -g status-right '#[fg=colour233,bg=colour241,bold]#(iwgetid -r) #(wifi_ip) #[fg=colour241,bg=colour233,bold] #(battery)  #[fg=colour233,bg=colour241,bold] %m/%d #[fg=colour233,bg=colour245,bold] %I:%M '
#set -g status-right '#[fg=colour233,bg=colour241,bold] %m/%d #[fg=colour233,bg=colour245,bold] %I:%M '
set -g status-right-length 50
set -g status-left-length 20

setw -g window-status-current-style fg=colour81,bg=colour238
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '

setw -g window-status-style fg=colour138,bg=colour235
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '

setw -g window-status-bell-style fg=colour255,bg=colour1

# }
# The messages {

#set -g message-attr bold
set -g message-style fg=colour232,bg=colour166

# }

bind m run -b /usr/local/bin/tmux2clip

#after selecting Ctrl+Space to copy and then paste like normal
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle


# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'

set -g @plugin 'wfxr/tmux-fzf-url'



# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'
