dotfiles

ref: 659185d4fe9a6b714787af36373b13ed7373f1f7

./tmux-sanity.conf


# utf8 is on
set -g utf8 on
set -g status-utf8 on

# 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

# 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

# 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 `#'
#

set -g window-status-activity-attr bold

set -g status-left '#S'
set -g status-right '%R | %d %b'

set -g window-status-format "#I #W "
set -g window-status-current-format "#I #W"

# 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 "reattach-to-user-namespace pbcopy"
bind -t vi-copy Escape cancel