# .tmux.conf
# cayla fauver <[email protected]>
# Created: Wed Jan 27, 2016 10:16AM

# general
set-option -g prefix C-a                # muscle memory from screen
bind-key a  send-prefix                 # need the begining of line goodness
bind-key C-a last-window                # classic screeen toggle window behaviour
unbind r
bind r source-file ~/.tmux.conf
set -g default-terminal "screen-256color"
set -g mouse on

set -g set-titles on
#set -g set-titles-string "#T"
set-option -g set-titles-string '#H:#S.#I.#P #W'

# vim direction controls
unbind Up
unbind Down
unbind Left
unbind Right
unbind C-Up
unbind C-Down
unbind C-Left
unbind C-Right
unbind M-Up
unbind M-Down
unbind M-Left
unbind M-Right
bind-key -r -T prefix k select-pane -U
bind-key -r -T prefix j select-pane -D
bind-key -r -T prefix h select-pane -L
bind-key -r -T prefix l select-pane -R
bind-key -r -T prefix M-k             resize-pane -U 5
bind-key -r -T prefix M-j           resize-pane -D 5
bind-key -r -T prefix M-h           resize-pane -L 5
bind-key -r -T prefix M-l          resize-pane -R 5
bind-key -r -T prefix H swap-window -t -1
bind-key -r -T prefix L swap-window -t +1

# pane control
set -g base-index 1                     # start windows and panes at zero
set -g pane-base-index 1
set-option -g renumber-windows on       # renumber windows as closed
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
bind-key S set-window-option synchronize-panes

# pane movement
bind-key g command-prompt -p "grab pane from:"  "join-pane -s ':%%'"
bind-key s command-prompt -p "send pane to:"  "join-pane -t ':%%'"

# copy paste
setw -g mode-keys vi                    # Use vim keybindings in copy mode
# this apparently isn't needed anymore?  and fyi future cayla, if you
# re-enable it for some reason, this causes the `1;2c` issue on linux
#set-option -g default-command "reattach-to-user-namespace -l zsh"
set-option -g history-limit 5000

bind-key w choose-window -F '#{window_flags} (#{window_panes})  #{window_name}'

set -g @themepack 'powerline/default/gray'
set -g @fingers-compact-hints 0

## plugings
set -g @plugin 'jimeh/tmux-themepack'
# set -g @plugin 'Morantron/tmux-fingers'

# Initialize TMUX plugin manager (keep this line at the very bottom of
# tmux.conf)
run '~/.tmux/plugins/tpm/tpm'