Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
83 lines (66 sloc) 3.13 KB
# Ring the bell if any background window rang a bell
set -g bell-action any
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal "screen-256color"
# Keep your finger on ctrl, or don't
bind-key ^D detach-client
bind-key p choose-session
# Create splits and vertical splits
bind-key v split-window -h
bind-key ^V split-window -h
bind-key s split-window
bind-key ^S split-window
# Reload tmux config
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
# C-l is more useful for clearing screen
# bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
# Use vi keybindings for tmux commandline input.
# Note that to get command mode you need to hit ESC twice...
set -g status-keys vi
# Use vi keybindings in copy and choice modes
setw -g mode-keys vi
# set first window to index 1 (not 0) to map more to the keyboard layout...
set-option -g base-index 1
set-window-option -g pane-base-index 1
# color scheme (styled as vim-powerline)
set -g status-left-length 52
set -g status-right-length 451
set -g status-fg black
set -g status-bg colour230 #252
set -g pane-border-fg colour245
set -g pane-active-border-fg colour39
# Command/message line colors
set -g message-fg colour16
set -g message-bg colour221
set -g message-attr bold
# Left side of status bar
set -g status-left '#[fg=colour235,bg=colour252,bold] ◊ #S #[fg=colour252,bg=colour238,nobold]#[fg=colour245,bg=colour238,bold] #(whoami) #[fg=colour238,bg=colour230,nobold]'
# Right side of status bar
set -g status-right "#[fg=black,bold]%H:%M#[default]"
# Inactive windows in status bar
set -g window-status-format "#[fg=colour230,bg=colour252]#[fg=colour235,bg=colour252,bold] #I #W #[fg=colour252,bg=colour230,bold]"
# Active windows in status bar
set -g window-status-current-format "#[fg=colour230,bg=colour39]#[fg=black,bg=colour39,noreverse,bold] #I: #W #[fg=colour39,bg=colour230,nobold]"
# Patch for OS X pbpaste and pbcopy under tmux.
set-option -g default-command "which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l $SHELL || $SHELL"
# Screen like binding
unbind C-b
set -g prefix C-a
bind a send-prefix
# No escape time for vi mode
set -sg escape-time 0
# Bigger history
set -g history-limit 10000
# Enable some mouse support
set -g mode-mouse on
setw -g mouse-select-window on
setw -g mouse-select-pane on
set -g mouse-resize-pane on
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"