2013-05-14 17:32:05 +00:00
|
|
|
# Use a 256 color terminal
|
2016-02-17 14:40:12 +00:00
|
|
|
set -g default-terminal "xterm-256color"
|
2013-05-14 17:32:05 +00:00
|
|
|
|
2013-05-12 19:29:46 +00:00
|
|
|
# zsh
|
2014-12-16 17:21:41 +00:00
|
|
|
set -g default-shell $SHELL
|
2013-05-12 19:29:46 +00:00
|
|
|
|
2013-11-23 19:00:03 +00:00
|
|
|
# bind default prefix to ctrl-a
|
|
|
|
set -g prefix C-a
|
|
|
|
unbind-key C-b
|
|
|
|
bind-key a send-prefix
|
|
|
|
|
2014-06-02 10:28:38 +00:00
|
|
|
# more history
|
2014-12-16 17:21:41 +00:00
|
|
|
set -g history-limit 10000
|
2014-06-02 10:28:38 +00:00
|
|
|
|
2013-11-24 17:52:33 +00:00
|
|
|
# Fix for sending keys to Vim
|
|
|
|
setw -g xterm-keys on
|
2013-11-23 19:00:03 +00:00
|
|
|
|
2014-01-14 13:39:40 +00:00
|
|
|
# set esc-timeout to 50ms (better vim)
|
|
|
|
set -sg escape-time 50
|
|
|
|
|
2013-11-23 19:00:03 +00:00
|
|
|
# use vim motions :-)
|
|
|
|
setw -g mode-keys vi
|
|
|
|
|
2012-09-22 13:23:04 +00:00
|
|
|
# Force a reload of te config file
|
|
|
|
unbind-key r
|
|
|
|
bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded!"
|
|
|
|
|
2014-12-16 17:21:41 +00:00
|
|
|
# Copy & Paste with clipper -- see https://github.com/wincent/clipper
|
|
|
|
# starting copy & paste with Ctrl+a [
|
2017-04-27 07:01:25 +00:00
|
|
|
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
|
|
|
|
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel "nc localhost 8377"
|
|
|
|
bind-key -T copy-mode-vi Escape send -X cancel
|
2014-12-16 17:21:41 +00:00
|
|
|
|
2014-03-26 15:33:00 +00:00
|
|
|
# Saner window splitting / new windows
|
|
|
|
bind-key \ split-window -h -c "#{pane_current_path}"
|
|
|
|
bind-key - split-window -v -c "#{pane_current_path}"
|
|
|
|
bind-key c new-window -c "#{pane_current_path}"
|
2013-11-23 19:00:03 +00:00
|
|
|
|
2012-09-22 13:23:04 +00:00
|
|
|
# Easier resizing
|
|
|
|
unbind-key -n C-j
|
|
|
|
unbind-key -n C-k
|
|
|
|
unbind-key -n C-h
|
|
|
|
unbind-key -n C-l
|
|
|
|
bind-key -r C-j resize-pane -D
|
|
|
|
bind-key -r C-k resize-pane -U
|
|
|
|
bind-key -r C-h resize-pane -L
|
|
|
|
bind-key -r C-l resize-pane -R
|
|
|
|
|
2014-09-24 13:01:38 +00:00
|
|
|
# Smart pane switching with awareness of vim splits
|
2014-12-16 17:21:41 +00:00
|
|
|
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
|
|
|
|
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
|
|
|
|
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
|
|
|
|
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
|
|
|
|
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
|
|
|
|
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
|
2013-11-23 19:00:03 +00:00
|
|
|
|
2012-09-22 13:23:04 +00:00
|
|
|
# Mouse support
|
2016-02-17 11:13:12 +00:00
|
|
|
set -g mouse on
|
2016-02-17 14:40:12 +00:00
|
|
|
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
|
|
|
|
bind -n WheelDownPane select-pane -t= \; send-keys -M
|
|
|
|
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
|
2012-09-22 13:23:04 +00:00
|
|
|
|
2013-11-23 19:00:03 +00:00
|
|
|
# counting panes starts at 1
|
2012-09-22 17:54:43 +00:00
|
|
|
set -g base-index 1
|
|
|
|
setw -g pane-base-index 1
|
2012-09-22 13:23:04 +00:00
|
|
|
|
2016-02-18 16:06:28 +00:00
|
|
|
# Disable assume-paste-time, so that iTerm2's "Send Hex Codes" feature works
|
|
|
|
# with tmux 2.1. This is backwards-compatible with earlier versions of tmux
|
|
|
|
set-option -g assume-paste-time 0
|
|
|
|
|
2012-09-22 13:23:04 +00:00
|
|
|
# How long should we show any messages?
|
2012-09-22 17:54:43 +00:00
|
|
|
set -g display-time 2000
|
2012-09-22 13:23:04 +00:00
|
|
|
|
2016-12-26 08:36:23 +00:00
|
|
|
# statusbar colors
|
2014-12-16 17:21:41 +00:00
|
|
|
set -g status-bg black
|
|
|
|
set -g status-fg yellow
|
|
|
|
set -g status-attr default
|
|
|
|
set -g pane-border-fg black
|
|
|
|
set -g pane-active-border-fg brightgreen
|
|
|
|
set -g message-bg black
|
|
|
|
set -g message-fg brightred
|
|
|
|
set -g display-panes-active-colour blue
|
|
|
|
set -g display-panes-colour brightred
|
2016-08-19 10:40:42 +00:00
|
|
|
setw -g window-status-fg white
|
2014-12-16 17:21:41 +00:00
|
|
|
setw -g window-status-bg default
|
|
|
|
setw -g window-status-current-fg brightred
|
|
|
|
setw -g window-status-current-bg default
|
|
|
|
setw -g clock-mode-colour green
|
2013-05-14 17:32:05 +00:00
|
|
|
|
2016-05-02 08:15:21 +00:00
|
|
|
# Custom status bar
|
2012-09-22 17:54:43 +00:00
|
|
|
set -g status-left-length 32
|
|
|
|
set -g status-right-length 150
|
|
|
|
set -g status-interval 5
|
|
|
|
set -g status-left-length 60
|
2016-08-19 10:40:42 +00:00
|
|
|
set -g status-left '#[fg=brightblack,bg=brightwhite,bold] ❐ #S #[fg=white,bg=default,nobold] ⣿ #P '
|
|
|
|
set -g status-right '#[fg=white,bg=default,nobold] #(whoami)@#h# #[fg=black,bg=white,nobold] #(date +"%H:%M") '
|
|
|
|
set -g window-status-format '#[fg=white,bg=default] #I #W'
|
|
|
|
set -g window-status-current-format '#[fg=black,bg=brightred]#[fg=white,bg=brightred,noreverse,bold] #I #W #[fg=brightred,bg=black,nobold]'
|