# Core options (https://github.com/tmux-plugins/tmux-sensible) # # address vim mode switching delay (http://superuser.com/a/252717/65504) 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 # upgrade $TERM set -g default-terminal "screen-256color" # 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 set -g status on # refresh 'status-left' and 'status-right' more often set -g status-interval 5 set -g status-justify left set -g status-position bottom set -g status-keys vi # Set status bar background and foreground color. set -g status-style fg=colour136,bg="#002b36" set -g status-left-style default set -g status-left "#[fg=green] ❐ #S #[default]" set -g status-right-style default # Set the inactive window color and style set -g window-status-style fg=colour244,bg=default set -g window-status-format ' #I #W ' # Set the active window color and style set -g window-status-current-style fg=black,bg=colour136 set -g window-status-current-format ' #I #W ' # Colors for pane borders(default) setw -g pane-border-style fg=colour240,bg=default setw -g pane-active-border-style fg=green,bg=default # 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 '❐ #S ● #I #W' set -g display-panes-time 800 # slightly longer pane indicators display time # 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 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 # Split windows into panes: CTRL-A + h or 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: CTRL-ALT + h l j k 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 # Switch windows: CTRL-ALT + left or right arrows bind-key -n C-M-Left previous-window bind-key -n C-M-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!" # Plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'laktak/extrakto' set -g @extrakto_split_size "10" # run tpm run -b '~/.tmux/plugins/tpm/tpm' # =========================== END OF FILE ===================================