dotfiles

ref: 17b0e4b44df8393bda331c6ccae8367eebf8afaa

./tmux.conf


# address vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0

# increase scrollback buffer size
set -g history-limit 10000

# tmux messages are displayed for 4 seconds
set -g display-time 2000

# refresh 'status-left' and 'status-right' more often
set -g status-interval 5

# enable mouse features for terminals that support it
set-option -g mouse on

# emacs key bindings in tmux command prompt (prefix + :) are better than
# vi keys, even for vim users
set -g status-keys emacs

# --- 

# Use C-s as a prefix
set -g prefix C-s
unbind C-b
bind C-s send-prefix

# Relax!
set -sg escape-time 0
set -sg repeat-time 600

# Make pbcopy and pbpaste work properly
set -g default-command "/bin/fish"

# Less stretching to get to the first item.
set -g base-index 1
setw -g pane-base-index 1

# Reload the config.
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"

# Saner splitting.
bind v split-window -h -c '#{pane_current_path}'
bind s split-window -v
bind S choose-session

# Pane movement
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# DVTM style pane selection
bind 1 select-pane -t 1
bind 2 select-pane -t 2
bind 3 select-pane -t 3
bind 4 select-pane -t 4
bind 5 select-pane -t 5
bind 6 select-pane -t 6
bind 7 select-pane -t 7
bind 8 select-pane -t 8
bind 9 select-pane -t 9

# Pane resizing
bind -r C-h resize-pane -L 5
bind -r C-j resize-pane -D 5
bind -r C-k resize-pane -U 5
bind -r C-l resize-pane -R 5

bind -r b select-window -t :-
bind -r n select-window -t :+

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

# Custom status bar
# Powerline symbols: ⮂ ⮃ ⮀ ⮁ ⭤
set -g status-left-length 32
set -g status-right-length 150

# Status reference
# ----------------
# #(shell-command)  First line of the command's output
# #[attributes]     Colour or attribute change
# #H                Hostname of local host
# #h                Hostname of local host without the domain name
# #F                Current window flag
# #I                Current window index
# #P                Current pane index
# #S                Session name
# #T                Current pane title
# #W                Current window name
# ##                A literal `#'
#

# Solarized reference
# -------------------

# base03    234
# base02    235
# base01    240
# base00    241
# base0     244
# base1     245
# base2     254
# base3     230
# yellow    136
# orange    166
# red       160
# magenta   125
# violet     61
# blue       33
# cyan       37
# green      64

set -g status-bg colour8
set -g window-status-activity-attr bold

set -g status-left '#[fg=colour16,bg=colour14,bold] #S #[fg=colour254,bg=colour16,nobold]'
set -g status-right '#[fg=colour245]#(itunes status) | %R | %d %b #[fg=colour254,bg=colour8,nobold]'

set -g window-status-format "#[fg=colour14,bg=colour8] #I #W "
set -g window-status-current-format "#[fg=colour16,bg=colour33,noreverse,bold] #I #W #[fg=colour33,bg=colour234,nobold]"

# Activity
setw -g monitor-activity on
set -g visual-activity off

# Autorename sanely.
setw -g automatic-rename on

# Better name management
bind c new-window -c '#{pane_current_path}' \; command-prompt "rename-window '%%'"
bind C new-window -c '#{pane_current_path}'
bind , command-prompt "rename-window '%%'"

# Copy mode
setw -g mode-keys vi
bind ` copy-mode
unbind [
unbind p
bind p paste-buffer
bind -t vi-copy v begin-selection
bind -t vi-copy y copy-pipe "xsel --clipboard --input"
bind -t vi-copy Escape cancel