# general
set -g base-index 1
set -g pane-base-index 1
set -g history-limit 5000

set -g escape-time 50

# don't spawn login shells
set -g default-command "$SHELL"

set -g default-terminal "screen-256color"
set -g terminal-overrides ",*256col*:Tc"

set -g alternate-screen off
setw -g aggressive-resize on

# style
setw -g window-status-current-style bold
set -g window-status-format "#I:#{?#{==:#W,mksh},$#{b:pane_current_path},#W}#F"
set -g window-status-current-format "#I:#{?#{==:#W,sh},$#{b:pane_current_path},#W}#F"

set -g status-bg black
set -g status-fg white

set -g status-left-length 50
set -g status-left "#[fg=blue](#[fg=white]#H#[fg=blue])  "

set -g status-right-length 50
set -g status-right "#[fg=blue]  (#[fg=magenta]%H:%M#[fg=blue])"

set -g status-justify centre

set -g pane-active-border-style fg=default,bg=default
set -g set-titles on
set -g set-titles-string "#H: #{?#{==:#W,sh},$#{b:pane_current_path},#W}"

set -g status-interval 0

# screen-like things
set -g prefix ^A
bind C-a last-window
bind a send-prefix
bind M-a next-window -a
bind c new-window -c ~
bind k confirm-before -p "kill-window #W? (y/n)" kill-window
bind K kill-window
bind S split-window

# custom bindings
bind 0 select-window -T -t ':.$'
bind C move-window -r
bind R source-file ~/.tmux.conf
bind v split-window -h
bind h split-window
bind . neww -c '#{pane_current_path}'
bind ^R neww rc
bind -n ^T run-shell -b "tmux-signal #{pane_pid} USR1"

bind -n C-left previous-window
bind -n C-right next-window

bind -n M-PPage copy-mode -u

bind-key u run-shell tmux-urls

set -s command-alias[100] renumber='move-window -r'
