Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
102 lines (77 sloc) 3.11 KB
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# fix insert mode exit lag in vim
set -sg escape-time 0
# start window indexing from 1
set -g base-index 1
setw -g pane-base-index 1
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq 'emacs\\|vim' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq 'emacs\\|vim' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq 'emacs\\|vim' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq 'emacs\\|vim' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq 'emacs\\|vim' && tmux send-keys 'C-\\') || tmux select-pane -l"
# cut and paste like vim
setw -g mode-keys vi
unbind p
bind p paste-buffer
# 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"
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# split windows evenly like vim
bind v split-window -h -c '#{pane_current_path}'
bind s split-window -v -c '#{pane_current_path}'
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf; display "Tmux config reloaded."
# resizing windows
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# 25%, horizontal
unbind T
bind T split-window -p 25
# 35%, vertical
unbind t
bind t split-window -p 35 -h
# 1%, horizontal
unbind Y
bind Y split-window -p 1
# longer scrollback buffer
set-option -g history-limit 10000
# needed for tmux
set-option -g default-command "reattach-to-user-namespace -l $SHELL"
# show simple time / date in right statusbar
set -g status-right '%l:%M %p | %h %d %Y '
#### COLOUR (Solarized 256)
# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg colour166 #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01
# message text
set-option -g message-bg colour235 #base02
set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour64 #green
# bell
set-window-option -g window-status-bell-style fg=colour235,bg=colour160 #base02, red