#
# -*- ~/.tmux.conf -*-
#  - vjt@openssl.it -
#
set -g mouse               on
set -g monitor-activity    off
#set -g default-terminal    "screen-256color"
set -g repeat-time         200

set -g clock-mode-style 12
set -g clock-mode-colour red
set -g focus-events on

set -g pane-active-border-style     fg='#ff0000'
set -g status-style                 fg='#ffffff',bg='#0000ff'
set -g window-status-current-style  fg='#ff5555'
set -g window-status-activity-style fg='#ffffff',bg='#000044'

set -g status-right             "#T"
set -g status-right-length      100
set -g status-right-style       bg='#ff0000',fg='#ffffff'

set -g history-limit 10000

# Allow programs inside tmux to set the outer terminal title (kitty tab)
set -g set-titles on
set -g set-titles-string "#{session_name} (#W) #{pane_title}"

# Use the window name, not the automatic program name
set -g automatic-rename on

set -g prefix C-f
unbind   C-b
bind-key C-f send-prefix

# C-f C-f switches between the last two windows
bind-key C-f last-window
bind-key 'f' last-pane

bind-key -   split-window
bind-key |   split-window -h

bind-key C-l respawn-pane -k
unbind-key l

unbind-key &
bind-key k confirm-before -p "Kill window #W?"  kill-window
bind-key \\ confirm-before -p "Kill session #S?" kill-session

bind-key '#' split-window 'htop'
bind-key 'm' command-prompt -p "man:" "split-window 'exec man %%'"
bind-key 'o' command-prompt -p "ssh:" "split-window 'exec ssh %%'"

bind-key -n S-Left  resize-pane -L 1
bind-key -n S-Up    resize-pane -U 1
bind-key -n S-Right resize-pane -R 1
bind-key -n S-Down  resize-pane -D 1

bind-key -n S-Pageup copy-mode -eu
bind-key -T copy-mode-vi S-Pagedown send-keys -X page-down

bind-key -n C-Up    select-pane -U
bind-key -n C-Down  select-pane -D
bind-key -n C-Right select-pane -R
bind-key -n C-Left  select-pane -L

bind-key P choose-buffer

bind-key = select-layout tiled

# Send keys to all panes
bind-key C-y set-window-option synchronize-panes \; display-message "synchronize-panes is now #{?pane_synchronized,on,off}"
