Skip to content
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
142 lines (102 sloc) 4.48 KB
# Core options (
# address vim mode switching delay (
set -s escape-time 0
# increase scrollback buffer size
set -g history-limit 50000
# tmux messages are displayed for 4 seconds
set -g display-time 4000
# refresh 'status-left' and 'status-right' more often
set -g status-interval 5
# upgrade $TERM
set -g default-terminal "screen-256color"
# emacs key bindings in tmux command prompt (prefix + :) are better than
# vi keys, even for vim users
#set -g status-keys emacs
# focus events enabled for terminals that support them
set -g focus-events on
# super useful when using "grouped sessions" and multi-monitor setup
setw -g aggressive-resize on
# ===========================================================================
# Other options
set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
setw -q -g utf8 on
# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
bind-key C-a last-window
unbind-key C-b
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
setw -g automatic-rename on # rename window to reflect current program
set -g renumber-windows on # renumber windows when a window is closed
set -g set-titles on # set terminal title
set -g set-titles-string '#h ❐ #S ● #I #W'
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g status-interval 10 # redraw status line every 10 seconds
# Allows for faster key repetition
set -s escape-time 0
## Status bar all
set -g status-fg colour236
#set -g status-bg colour102
# Left
set -g status-left-fg black
set -g status-left 'tmux ###S|'
# Right
set -g status-right-fg black
set -g status-right '%a %b %d, %Y %H:%M'
## Window options color
set-window-option -g window-status-current-fg black
# Notifications
setw -g monitor-activity on
setw -g visual-activity on
# Auto rename
set-window-option -g automatic-rename off
set-option -g allow-rename off
# Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session
bind-key a send-prefix
# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on
# Splitting windows into panes with h and v
bind-key h split-window -v -c '#{pane_current_path}'
bind-key v split-window -h -c '#{pane_current_path}'
# Set up resize-pane keys
bind-key -n C-M-h resize-pane -L 1
bind-key -n C-M-l resize-pane -R 1
bind-key -n C-M-j resize-pane -D 1
bind-key -n C-M-k resize-pane -U 1
# Use Alt-arrow keys without prefix key to switch panes
bind-key -n M-Left select-pane -L
bind-key -n M-Right select-pane -R
bind-key -n M-Up select-pane -U
bind-key -n M-Down select-pane -D
# Shift arrow to switch windows
bind-key -n S-Left previous-window
bind-key -n S-Right next-window
set-window-option -g mode-keys vi
# -- copy mode -----------------------------------------------------------------
bind Enter copy-mode # enter copy mode
run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true'
run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true'
#run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true'
#run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true'
run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true'
run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true'
# copy to Mac OSX clipboard
if -b 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | reattach-to-user-namespace pbcopy"'
# copy to X11 clipboard
if -b 'command -v xsel > /dev/null 2>&1' 'bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"'
# copy to Ms Windows clipboard
if -b '[ -c /dev/clipboard ]' 'bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "tmux save-buffer - > /dev/clipboard"'
# Move windows on the left (/) or on the right (*)
bind-key / swap-window -t -1
bind-key * swap-window -t +1
# Reload tmux config
unbind r
bind r source-file ~/.tmux.conf \; display-message "config reloaded!"
# =========================== END OF FILE ===================================
You can’t perform that action at this time.