# move around panes with j and k, a bit like vim
# as of tmux 1.1, there is no way to move based on pane position (ie, no way to
# move the pane to the right)
setw -g mode-keys vi
# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by, only
# one at a time can be slow
bind < resize-pane -L 1
bind > resize-pane -R 1
bind - resize-pane -D 1
bind + resize-pane -U 1
# bind a last-window
bind ^A last-window

unbind .
bind . send-keys ':syntax on
:autocmd BufReadPost *
:set background=light
:nnoremap <C-t> hxpl
:set tabstop=2
:set shiftwidth=2
:set smartindent
:set encoding=utf8
:set fileencoding=utf8
:set number
'
unbind ,
bind , send-keys 'MYPROMPT=">"; PS1="\[\033[0;32;1m\]\t\[\033[0m\] \u@\h:\w$MYPROMPT " ; if [ $(whoami) = "root" ]; then MYPROMPT="#"; PS1="\[\033[0;32;1m\]\t\[\033[0m\] \h:\w$MYPROMPT " ; fi; PROMPT_COMMAND="echo -ne \"\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007\""; alias ls="ls --color -a -h"; alias ll="ls --color -a -h -l"; alias grep="grep --color"; . /etc/bash_completion; eval $(dircolors) ; set show-all-if-ambiguous on; export HISTCONTROL=ignoredups; export LANG=en_US.UTF-8; export LOCKPRG=/bin/true; set -o vi;
'

set -g display-time 3000
set -g status-bg red
set -g status-fg black
set-window-option -g window-status-current-attr bright,reverse
set-window-option -g window-status-current-bg cyan
set-window-option -g window-status-current-fg black

set-environment -g SSH_AUTH_SOCK /home/wogri/.ssh-agent-tmux

# listen for activity on all windows
set -g bell-action any
set-option visual-content on
set-option visual-activity on

# scrollback buffer n lines
set -g history-limit 5000
set-window-option -g utf8 on

setw -g remain-on-exit on

# Prefix key.
set -g prefix C-a
unbind C-b
bind C-a send-prefix

# wogriat
new -d -s wogriat -n nix 'ssh-agent -a /home/wogri/.ssh-agent-tmux -t 43200 bash'
neww -d -n nixx
neww -d -n mutt mutt
set -t wogriat status-bg green
neww -d -n jabber mcabber
setw -t wogriat:mutt monitor-activity on
# notify if a plus turns up, which basically means: "new message in mcabber" 
setw -t wogriat:jabber monitor-content '+'
neww -d -n irc 'irssi -c vienna.irc.at -n wogri'
neww -d -n xen1 'sleep 20; ssh root@xen-server'
neww -d -n mail 'sleep 20; ssh root@mail-server'
split-window -d -v -l 5 -t wogriat:mail 'sleep 20; ssh root@mail-server "tail -F /var/log/mail.log" | ./bin/highlight.pl light'
# resize-pane -D -t wogriat:mail.1 15 
neww -d -n web0 'sleep 20; ssh root@web-server'
split-window -d -v -l 5 -t wogriat:web0 'sleep 20; ssh root@web-server "tail -F /var/log/nginx/*.error.log /var/log/auth.log /var/log/error*log" | ./bin/highlight.pl light'
neww -d -n db 'sleep 20; ssh root@db-server'
neww -d -n list 'sleep 20; ssh root@list-server'
neww -d -n nix1
neww -d -n nix2
neww -d -n nix3
neww -d -n nix4
neww -d -n nix5
neww -d -n nix6


# company1
new -d -s company1 -n mail-server 'sleep 20; ssh root@mail.company1.at'
set -t company1 status-bg cyan
neww -d -n mailgod 'sleep 20; ssh root@mailgod.company1.net'
neww -d -n greylister1 'sleep 20; ssh root@greylister1.company1.net'
neww -d -n greylister2 'sleep 20; ssh root@greylister2.company1.net'
neww -d -n web2 'sleep 20; ssh root@web2.company1.net'
neww -d -n web3 'sleep 20; ssh root@web3.company1.net'
neww -d -n ns1 'sleep 20; ssh root@ns1.company1.net'
neww -d -n ns2 'sleep 20; ssh root@ns2.company1.net'
neww -d -n vserver3-produktiv 'sleep 20; ssh root@vserver3-produktiv.company1.net'
neww -d -n virtualizer 'sleep 20; ssh root@virtualizer.company1.net'


# company2
new -d -s company2 -n workhorse 'sleep 20; ssh wh@workhorse.company2'
set -t company2 status-bg red
neww -d -n appserver1 'sleep 20; ssh -t wh@workhorse.company2 "ssh appserver@appserver.company2"'
neww -d -n appserver2 'sleep 20; ssh -t wh@workhorse.company2 "ssh appserver@appserver.company2"'
neww -d -n appserver3 'sleep 20; ssh -t wh@workhorse.company2 "ssh appserver@appserver.company2"'
neww -d -n db 'sleep 20; ssh -t wh@workhorse.company2 "ssh root@db.company2"'
neww -d -n nixserv1 'sleep 20; ssh -t wh@workhorse.company2 "ssh root@nixserv.company2"'
neww -d -n nixserv2 'sleep 20; ssh -t wh@workhorse.company2 "ssh root@nixserv2.company2"'
neww -d -n nixserv3 'sleep 20; ssh -t wh@workhorse.company2 "ssh root@nixserv3.company2"'
neww -d -n rs1 'sleep 20; ssh -t wh@workhorse.company2 "ssh root@rs1.company2"'
neww -d -n rs2 'sleep 20; ssh -t wh@workhorse.company2 "ssh root@rs2.company2"'
neww -d -n rs3 'sleep 20; ssh -t wh@workhorse.company2 "ssh root@rs3.company2"'

select-window -t wogriat:nix
