Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
111 lines (84 sloc) 3.49 KB
# set prefix to ctrl+a
unbind C-b
set -g prefix C-a
bind a send-prefix
# reload configuration
bind R source-file ~/.tmux.conf \; display 'Reloaded'
set -g default-terminal 'screen-256color'
# support system pasteboard on OS X
set-option -g default-command "$(which reattach-to-user-namespace > /dev/null && echo reattach-to-user-namespace -l $SHELL || echo exec $SHELL -l)"
# C-a C-c: copy tmux buffer to system pasteboard
# C-a C-v: paste system pasteboard into tmux window
# C-c in copy mode: copy selection to system pasteboard
bind-key C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind-key C-v run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
bind-key -t vi-copy C-c copy-pipe "reattach-to-user-namespace pbcopy"
# Add cursor shape escape sequences for iTerm
# https://github.com/sjl/vitality.vim/issues/8
set-option -g terminal-overrides '*88col*:colors=88,*256col*:colors=256,xterm*:XT:Ms=\E]52;%p1%s;%p2%s\007:Cc=\E]12;%p1%s\007:Cr=\E]112\007:Cs=\E]50;CursorShape=%?%p1%{3}%<%t%{0}%e%p1%{2}%-%;%d\007'
# Prevent delay when pressing Esc in Vim
set-option -g escape-time 0
# prevent ssh-agent (SSH_AUTH_SOCK) from being overwritten when a pair connects
set -g update-environment ""
# status bar
set-option -g status-utf8 on
set-option -g status-fg colour15
set-option -g status-bg colour236
set-option -g window-status-activity-attr bold
set-option -g pane-border-fg colour245
set-option -g pane-active-border-fg colour39
set-option -g message-fg colour16
set-option -g message-bg colour221
set-option -g message-attr bold
set-option -g status-left '#[bg=colour148]#[fg=colour22] #S #[default]'
set-option -g status-right '#(which _wemux_status &> /dev/null && _wemux_status || wemux status_users) #[fg=colour148]#(date "+%H:%M")#[default] #[bg=colour252]#[fg=colour236] #(whoami)@#h #[default]'
set-option -g status-interval 5
set-option -g status-right-length 60
set -g window-status-format "#[fg=colour240,bg=colour234] #I #[fg=white]#W #[fg=colour240]#F "
set -g window-status-current-format "#[fg=colour16,bg=colour39,bold] #I #W #[fg=colour25]#F "
setw -g monitor-activity on
set -g display-time 1000
# scrollback buffer size increase
set -g history-limit 500000
# jumping to panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# window/pane management
set -g base-index 1
set -g set-titles on
setw -g automatic-rename on
bind w display-panes # display visible indicator of each pane
# pane dividers colors
setw -g pane-border-fg white
setw -g pane-border-bg colour236
setw -g pane-active-border-fg yellow
setw -g pane-active-border-bg blue
# opening new windows and panes
bind-key c new-window -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
# resizing
bind -r < resize-pane -L 3
bind -r > resize-pane -R 3
bind -r + resize-pane -U 1
bind -r - resize-pane -D 1
# C-A C-A to switch windows (like screen)
bind-key C-a last-window
# C-a C-k to close windows
bind C-k confirm-before kill-window
# C-a r to renumber windows
bind r move-window -r \; refresh-client
# reorder windows
bind-key H swap-window -t -1
bind-key L swap-window -t +1
# C-a C-l to clear window
bind-key C-l send-keys -R \; clear-history
# copy/paste more like vim
# C-A [ enters copy mode, C-A ] pastes
set-window-option -g mode-keys vi
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
bind-key -t vi-copy 'Y' copy-end-of-line
bind-key -t vi-copy 'V' select-line
Something went wrong with that request. Please try again.