Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
102 lines (83 sloc) 2.82 KB
# ~/.tmux.conf
#
# Author: Russell Parker
# --------------------
# prefix
# --------------------
unbind C-b
set -g prefix C-a
bind-key C-a send-prefix
# --------------------
# general
# --------------------
set -g default-terminal "screen-256color"
set -g history-limit 10000
setw -g xterm-keys on
set -g set-titles on
set -g set-titles-string '"#S"@#H #I: #W'
set -g default-command /bin/bash # source .bashrc
setw -gq utf8 on # uneccessary after 2.2
set -g escape-time 0 # quicker escapes
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
# --------------------
# clock settings
# --------------------
set -g clock-mode-colour yellow
setw -g clock-mode-style 12
# --------------------
# clipboard
# --------------------
set -g set-clipboard on
#bind -t vi-copy 'y' "copy-pipe 'xsel --input --clipboard'"
# --------------------
# vi mode
# --------------------
set -g status-keys vi
setw -g mode-keys vi
#bind -t vi-copy 'v' begin-selection
# --------------------
# bell
# --------------------
# --------------------
# window handling
# --------------------
set -g allow-rename off
set -g renumber-windows on
# --------------------
# status bar
# --------------------
set -g status on
set -g status-position top
set -g status-justify centre
set -gq status-utf8 on # unecessrary after 2.2
set -g status-left '"#S"@#h'
set -g status-left-length 25
set -g status-right '%a %l:%M%P'
set -g status-right-length 12
setw -g window-status-format '#I: #W#F '
setw -g window-status-current-format '#I: #W#F '
# --------------------
# version-specific
# --------------------
# slice version string from 6th char onward
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)"
# style commands
if-shell -b '[ "$(echo "$TMUX_VERSION < 1.9" | bc)" = 1 ]' \
"setw -g window-status-bell-attr 'bg=magenta,fg=white,bold,noreverse'; \
setw -g window-status-bell-attr 'bold,reverse'; \
set -g bell-action any"
# updated style
if-shell -b '[ "$(echo "$TMUX_VERSION >= 1.9" | bc)" = 1 ]' \
"setw -g window-status-current-style 'bg=magenta,fg=white,bold,noreverse'; \
setw -g window-status-bell-style 'bold,reverse'; \
set -g bell-action other"
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.1" | bc)" = 1 ]' \
"set -g mouse off"
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.4" | bc)" = 1 ]' \
"bind-key -T copy-mode-vi 'v' send -X begin-selection; \
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel"
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.6" | bc)" = 1 ]' \
"set -g bell-on-alert on"
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.6" | bc)" = 1 ]' \
"bind-key -T copy-mode-vi 'v' send -X begin-selection; \
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel"