# Truck's tmux config, started with the tmux productive book.

# fix the prefix to control-a and remap control-a to work like screen
set -g prefix C-a
unbind C-b
bind-key a send-prefix
bind-key C-a last-window

# faster response
set -sg escape-time 0

# colors woot
set -g default-terminal "screen-256color"

# 1-based window numbering
set -g base-index 1
setw -g pane-base-index 1

# reloader
bind r source-file ~/.tmux.conf \; display "Ok! I'm Reloaded!"

# splittage
bind | split-window -h
bind - split-window -v

# I dunno about this vi shit, yeah fuck that, be more awesome.
# this not only is ijkm, proper movement, but adds tab and enter to the mix.
bind C-i select-pane -U
bind C-j select-pane -L
bind C-k select-pane -R
bind C-m select-pane -D

# cycle thru windows, which seems... no. bullshit. that is p and n. period.

# what I _do_ want is resize on those, like in awesome.
bind -r H resize-pane -L 5
bind -r L resize-pane -R 5
bind -r I resize-pane -U 5
bind -r M resize-pane -D 5

#set -g mouse-utf8 on
set -g mouse on
#mouse select-resize
#set -g mouse-select-pane on
#set -g mouse-resize-pane on
#set -g mouse-select-window on


# choose colors wisely! why the fuck did I say that
set -g status-fg colour202
set -g status-bg colour17
set -g window-status-fg colour184
set -g window-status-bg colour234
set -g pane-border-fg colour61
set -g pane-border-bg colour8
set -g pane-active-border-fg colour6
set -g pane-active-border-bg colour24

#set -g message-fg colour190
#set -g message-bg colour18
set -g message-bg colour160
set -g message-fg colour252

#status bar
# H-hostname, h, hostname without domain  ##- a #
# Window:
# F - Flag, I - Index  T- Title  W - Name
# Pane index: P  Screen index: S  
# #(shell command result line 1)
#[colorchangestuffs]

#set -g status-utf8 on
#set -g status-left "#[fg=colour83]#S ䷀#[bg=colour22]#I#[bg=colour156,fg=colour20]𝕡#P#[fg=colour150,bg=colour55] ≋ #W"
#set -g status-left-length 40
#set -g status-right "%Y/%m/%e %H:%M %Z"
source "/home/truck/.local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf"

setw -g monitor-activity on
set -g visual-activity on

set -g status-justify left

# mouse fixin's

# the blog where this came from is fuckign bullshit with it's copy paste blocking
# anyway. toggle mousemode on/off

bind m \
 set -g mouse on\; \
 display 'M: ON'

bind M \
 set -g mouse off \; \
 display 'M: OFF'

bind C-v command-prompt -p compose "if '~/bin/tmuxcompose/compose.py \\%% | tmux load-buffer -' 'pasteb -d' 'display notfound'"
