# Set the prefix to ^z
#unbind-key C-b
set-option -g prefix C-z
bind-key C-z send-prefix

# screen ^C c 
unbind-key ^C
bind-key ^C new-window
unbind-key c
bind-key c new-window

# detach ^D d
unbind-key ^D
bind-key ^D detach

# displays * 
unbind-key *
bind-key * list-clients

# next ^@ ^N sp n 
unbind-key ^@
bind-key ^@ next-window
unbind-key ^N
bind-key ^N next-window
unbind-key " "
bind-key " " next-window
unbind-key n
bind-key n next-window

# title A
unbind-key A
bind-key A command-prompt "rename-window %%"

# prev ^H ^P p ^? 
unbind-key ^H
bind-key ^H previous-window
unbind-key ^P
bind-key ^P previous-window
unbind-key p
bind-key p previous-window
# unbind-key BSpace
# bind-key BSpace previous-window

# windows ^W w 
unbind-key ^W
bind-key ^W list-windows
unbind-key w
bind-key w list-windows

# redisplay ^L l 
unbind-key ^L
bind-key ^L refresh-client
unbind-key l
bind-key l refresh-client

# " windowlist -b
unbind-key '"'
bind-key '"' choose-window

# Copy mode
bind-key ^[ copy-mode
bind-key Escape copy-mode

# Paste mode
bind-key ] paste-buffer
bind-key ^] paste-buffer
set-window-option -g mode-keys emacs
# Make mouse useful in copy mode
#set-window-option -g mode-mouse on

# drew paste
bind-key P run-shell 'tmux saveb -| curl -s -XPOST -H "Content-type: text/plain" --data-binary @- http://p.draines.com/'

# More straight forward key bindings for splitting
#unbind-key %
bind-key | split-window -h
bind-key h split-window -h
#unbind-key '"'
bind-key - split-window -v
bind-key v split-window -v

# History
set-option -g history-limit 15000

# Status Bar
set-option -g status-bg colour246
set-option -g status-fg white
set-option -g status-left-length 15
set-option -g status-left ' #[fg=cyan,bright]#10H#[fg=green]:#[fg=white]#S#[fg=green] | #[default]'
set-option -g status-right '#[fg=green]| #[fg=yellow]%Y-%m-%d %H:%M '
set-option -g status-justify centre
set-window-option -g window-status-current-fg colour246
set-option -g status-position top

# Notifying if other windows has activities
set-window-option -g monitor-activity off
set-option -g visual-activity off

# Highlighting the active window in status bar
set-window-option -g window-status-current-fg cyan

# Clock
set-window-option -g clock-mode-colour white
set-window-option -g clock-mode-style 24

# don't clobber ssh agent
set-option -g update-environment "DISPLAY WINDOWID GPG_AGENT_INFO"

## Custom status bar, via https://github.com/myusuf3/dotfiles
## Powerline symbols: ⮂ ⮃ ⮀ ⮁ ⭤
## If you do not have a patched font (see: https://github.com/Lokaltog/vim-powerline/tree/develop/fontpatcher)
## comment out the lines below to get a "regular" statusbar without special symbols
set-option -g status-bg colour246
set-option -g message-fg colour246
set-option -g message-bg colour221
set-option -g status-left-length 40
set-option -g status-right-length 40
set-option -g status-interval 5
set-option -g pane-border-fg colour245
set-option -g pane-active-border-fg colour39
set-option -g status-justify left

set-option -g window-status-format "#[fg=white,bg=colour246] #I #W "
set-option -g window-status-current-format "#[fg=colour246,bg=colour39]⮀#[fg=colour231,bg=colour39,noreverse,bold] #I ⮁ #W #[fg=colour39,bg=colour246,nobold]⮀"

set-option -g default-terminal "screen-256color"

set -g base-index 1
