# -- general ------------------------------------------------------------------- set -g default-terminal "screen-256color" # colors! set-option -ga terminal-overrides ",*256col*:Tc" setw -g xterm-keys on set -s escape-time 10 # faster command sequences set -sg repeat-time 600 # increase repeat timeout set -s focus-events on unbind C-b set -g prefix C-x bind C-x send-prefix set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2) setw -q -g utf8 on set -g history-limit 5000 # boost history # reload configuration bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced' # -- display ------------------------------------------------------------------- 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 display-panes-time 800 # slightly longer pane indicators display time set -g display-time 1000 # slightly longer status messages display time # clear both screen and history bind -n C-l send-keys C-l \; run 'sleep 0.1' \; clear-history # activity set -g monitor-activity on set -g visual-activity off # mouse set -g mouse on # -- navigation ---------------------------------------------------------------- # create session bind C-c new-session # find session bind C-f command-prompt -p find-session 'switch-client -t %%' # split current window horizontally bind - split-window -v -c "#{pane_current_path}" # split current window vertically bind _ split-window -h -c "#{pane_current_path}" # pane navigation bind -r h select-pane -L # move left bind -r j select-pane -D # move down bind -r k select-pane -U # move up bind -r l select-pane -R # move right bind > swap-pane -D # swap current pane with the next one bind < swap-pane -U # swap current pane with the previous one # pane resizing bind -r H resize-pane -L 2 bind -r J resize-pane -D 2 bind -r K resize-pane -U 2 bind -r L resize-pane -R 2 # window navigation unbind n unbind p bind -r C-h previous-window # select previous window bind -r C-l next-window # select next window bind Tab last-window # move to last active window # -- copy mode ----------------------------------------------------------------- bind Enter copy-mode # enter copy mode setw -g mode-keys vi 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 H send -X start-of-line 2> /dev/null || true' run -b 'tmux bind -t vi-copy L end-of-line 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true' # -- buffers ------------------------------------------------------------------- bind b list-buffers # list paste buffers bind p paste-buffer # paste from the top paste buffer bind P choose-buffer # choose which buffer to paste from # -- status line ------------------------------------------------------------------- # tmux-mode-indicator set -g @mode_indicator_empty_prompt ' ◇ ' set -g @mode_indicator_empty_mode_style 'bg=term,fg=color2' set -g @mode_indicator_prefix_prompt ' ◈ ' set -g @mode_indicator_prefix_mode_style 'bg=color2,fg=color0' set -g @mode_indicator_copy_prompt '  ' set -g @mode_indicator_copy_mode_style 'bg=color10,fg=color0' set -g @mode_indicator_sync_prompt '  ' set -g @mode_indicator_sync_mode_style 'bg=color6,fg=color0' set -g status "on" set -g status-interval 1 set -g status-position top set -g status-right-length 80 set -g status-justify left set -g status-style "bg=terminal,fg=color10" set -g status-left '#{tmux_mode_indicator}' setw -g window-status-format " #[bg=color4,fg=color0,noreverse]▓░ #W " setw -g window-status-current-format " #[bg=color10,fg=color0,noreverse]▓░ #W " # -- plugins ------------------------------------------------------------------- # List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'nhdaly/tmux-better-mouse-mode' set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'MunifTanjim/tmux-mode-indicator' # install tpm if "test ! -d ~/.tmux/plugins/tpm" \ "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'" run '~/.tmux/plugins/tpm/tpm'