########## final working tweaks #######

# for mouse support, comment out unneeded section

# enable mouse support in tmux < 2.1
# setw -g mode-mouse on
# set -g mouse-select-pane on
# set -g mouse-resize-pane on
# set -g mouse-select-window on

# enable mouse support in tmux >= 2.1
set-option -g mouse on

# scroll speed 1 for tmux 2.4 and older
bind -Tcopy-mode WheelUpPane send -N1 -X scroll-up
bind -Tcopy-mode WheelDownPane send -N1 -X scroll-down
set -g @scroll-speed-num-lines-per-scroll 1

# scroll limit increase (def is 2000)
set-option -g history-limit 50000

# pane sync with just control-s
# bind -n C-s set-window-option synchronize-panes

# pane sync control-a (or prefix) then control-s
bind C-s set-window-option synchronize-panes

# stop auto renaming windows / tabs - I name my tabs often with ^a Shift-a and its annoying having them rename back
# set allow-rename off # <-- this didn't error, but it also didn't work they still renamed. one below worked
set-window-option -g allow-rename off

# swap windows/tab with Control-Shift-left or right arrow (works in 2.9 and newer)
# bind -n C-S-Left swap-window -t -1\; select-window -t -1
# bind -n C-S-Right swap-window -t +1\; select-window -t +1

# swap windows/tabs, if above didn't travel with the window/tab, comment out above, and uncomment this (works prior to 2.9)
bind -n C-S-Left swap-window -t -1
bind -n C-S-Right swap-window -t +1

# disable + enable panes with Prefix + O or I (useful for panes)
# to help remember: think of I as 1 for enabled. think of O as 0 for nothing / disabled
unbind O
bind O select-pane -d
unbind I
bind I select-pane -e

# add option to respawn pane and kill current process (useful if stuck ssh session)
unbind R
bind R respawn-pane -k

# current tab or window will be red in the tab bar (works pre 2.9)
# set-window-option -g window-status-current-bg red 
# current tab or window will be red in the tab bar (works 2.9+)
# set-window-option -g window-status-current-style bg=red

# 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}"

# kill panes and windows(tab)
bind K confirm-before "kill-window"
bind k confirm-before "kill-pane"

# END OF FILE
