#-------~---~----------~----------~----
#       .---..-.-.-..-..-..-..-.
#       `| |'| | | || || | >  <
#        `-' `-'-'-'`----''-''-'
#-------~---~----------~----------~----
# file: $HOME/.tmux.conf
#-------~---~----------~----------~----
#
# @user:       crshd <crshd@mail.com>
# @updated:    2011/06/24
# @revision:   2
#
#-------~---~----------~----------~----
#
# + Software used ATOC:
# `-> tmux      => 1.4-3
#
#-------~---~----------~----------~----

#-------~---~----------~----------~----
# KEYBINDS
#-------~---~----------~----------~----

set -g prefix ^a
set -g status-keys vi
setw -g mode-keys vi
set-option -g status-position top
set -g lock-command vlock
bind L lock-session
set -g mouse on
#set -g mouse select-pane on
#set -g mouse resize-pane on
#set -g mouse select-window on



#bind C-^{ run '~/.starling/powerline/mute_powerline.sh left'      #Mute left statusbar.
#bind C-^} run '~/.starling/powerline/mute_powerline.sh right'     #Mute right statusbar.
unbind [
unbind ]
bind [ set -g mouse on
bind ] set -g mouse off
#bind } paste-buffer

# Unbinds
# `-> these are part of the default mappings 
#     and will get new functionality
unbind i
unbind l
unbind s
unbind w

bind Left  previous-window
bind Right next-window

bind F12 source-file ~/.tmux.conf
bind w neww
bind m choose-window
bind a choose-session
bind x kill-pane
bind t set status
bind * run-shell "dashboard fix"
bind -n ^F1 select-window -t 1
bind -n ^F2 select-window -t 2
bind -n ^F3 select-window -t 3
bind -n ^F4 select-window -t 4
bind -n ^F5 select-window -t 5
bind -n ^F6 select-window -t 6
bind -n ^F7 select-window -t 7
bind -n ^F8 select-window -t 8
bind -n ^F9 select-window -t 9
bind -n ^F10 select-window -t 10
bind -n ^F11 select-window -t 11
bind -n ^F12 select-window -t 12

bind ^h select-pane -L
bind ^j select-pane -D
bind ^k select-pane -U
bind ^l select-pane -R

bind h resize-pane -L
bind j resize-pane -D
bind k resize-pane -U
bind l resize-pane -R

bind F1 select-pane -t 1
bind F2 select-pane -t 2
bind F3 select-pane -t 3
bind F4 select-pane -t 4
bind F5 select-pane -t 5
bind F6 select-pane -t 6
bind F7 select-pane -t 7
bind F8 select-pane -t 8
bind F9 select-pane -t 9
bind F10 select-pane -t 10
bind F11 select-pane -t 11
# bind F12 select-pane -t 12

bind - split-window -v
bind / split-window -h

#-------~---~----------~----------~----
# WINDOWS & PANES
#-------~---~----------~----------~----

# Start counting at 1
set -g base-index 0

#set -g mouse-select-pane on
#set -g pane-border-fg black
#set -g pane-active-border-fg red
#set -g display-panes-colour white
#set -g display-panes-active-colour red
#set -g display-panes-time 1000

setw -g automatic-rename on
setw -g monitor-activity on
#setw -g utf8 on

#-------~---~----------~----------~----
# MISC SETTINGS
#-------~---~----------~----------~----

#set -g default-shell /bin/bash
#set -g default-command /bin/bash
set -g set-titles on
set -g set-titles-string 'tmux: #T'
set -g repeat-time 100
set -g default-terminal "screen-256color"
setw -g clock-mode-colour red
setw -g clock-mode-style 12
setw -g alternate-screen on

# Don't close windows
#set -g set-remain-on-exit off
bind-key ^z respawn-window

#-------~---~----------~----------~----
# STATUS & MESSAGE
#-------~---~----------~----------~----

#
# Powerline Cyan Block - Tmux Theme
# Created by Jim Myhrberg <contact@jimeh.me>.
#
# Inspired by vim-powerline: https://github.com/Lokaltog/powerline
#
# Requires terminal to be using a powerline compatible font, find one here:
# https://github.com/Lokaltog/powerline-fonts
#

# Status update interval
set -g status-interval 1

# Basic status bar colors
set -g status-fg colour214
set -g status-bg colour255

# Left side of status bar
#set -g status-left-bg colour233
#set -g status-left-fg colour243
#set -g status-left-length 40
set -g status-left ''

# Right side of status bar
#set -g status-right-bg colour233
#set -g status-right-fg colour243
#set -g status-right-length 150
set -g status-right ''

# Window status
set -g window-status-format " #I:#W#F "
set -g window-status-current-format " #I:#W#F "

# Current window status
#set -g window-status-current-bg colour39
#set -g window-status-current-fg colour208

# Window with activity status
#set -g window-status-activity-bg colour75 # fg and bg are flipped here due to
#set -g window-status-activity-fg colour233 # a bug in tmux

# Window separator
set -g window-status-separator ""

# Window status alignment
set -g status-justify centre

# Pane border
#set -g pane-border-bg default
#set -g pane-border-fg colour238

# Active pane border
#set -g pane-active-border-bg default
#set -g pane-active-border-fg colour39

# Pane number indicator
set -g display-panes-colour colour233
set -g display-panes-active-colour colour245

# Clock mode
set -g clock-mode-colour colour39
set -g clock-mode-style 24

# Message
#set -g message-bg colour39
#set -g message-fg black

# Command message
#set -g message-command-bg colour233
#set -g message-command-fg black

# Mode
#set -g mode-bg colour39
#set -g mode-fg colour232


#### COLOUR (Solarized 256)

# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
#set-option -g status-attr default

# default window title colors
#set-window-option -g window-status-fg colour244 #base0
#set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim

# active window title colors
#set-window-option -g window-status-current-fg colour166 #orange
#set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright

# pane border
#set-option -g pane-border-fg colour235 #base02
#set-option -g pane-active-border-fg colour240 #base01

# message text
#set-option -g message-bg colour235 #base02
#set-option -g message-fg colour166 #orange

# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange

# clock
set-window-option -g clock-mode-colour colour64 #green

# bell
set-window-option -g window-status-bell-style fg=colour235,bg=colour160 #base02, red

#screen lock
set -g lock-command vlock
set -g lock-after-time 0 # Seconds; 0 = never
bind l lock-session

bind [ set -g mouse on
bind ] set -g mouse off

set -g mouse on
