set -g default-terminal "tmux-256color" set -g mouse on set -g mode-keys vi # Better clipboard on mousedrag (https://unix.stackexchange.com/a/349020) # Disable xterm escape sequences for setting clipboard set -s set-clipboard off # Copy selection into primary selection (without aborting) bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "xclip -se p" # https://github.com/neovim/neovim/wiki/FAQ#cursor-shape-doesnt-change-in-tmux set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' # Set C-a as new prefix unbind C-b set-option -g prefix C-a bind-key C-a send-prefix # Split panes with > and < unbind % bind-key < split-window -v -c "#{pane_current_path}" unbind '"' bind-key > split-window -h -c "#{pane_current_path}" # Create new window in current path bind-key -T prefix c new-window -c "#{pane_current_path}" # Change panes with Alt- bind -n M-Left select-pane -L bind -n M-Right select-pane -R bind -n M-Up select-pane -U bind -n M-Down select-pane -D unbind -T prefix l bind -T prefix h select-pane -L bind -T prefix j select-pane -D bind -T prefix k select-pane -U bind -T prefix l select-pane -R # Allow holding Ctrl after pressing the prefix bind -T prefix C-h select-pane -L bind -T prefix C-j select-pane -D bind -T prefix C-k select-pane -U bind -T prefix C-l select-pane -R # Resize panes with Alt-Shift- bind -n M-S-Left resize-pane -L # Change installation location of plugins set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.config/tmux/plugins/' ## Plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-continuum' set -g @plugin 'tmux-plugins/tmux-prefix-highlight' # Capture pane content set -g @resurrect-capture-pane-contents 'on' # Change keybindings set -g @resurrect-save 'C-s' set -g @resurrect-restore 'C-s' # Save session every 5 min set -g @continuum-save-interval '5' # Last saved environment is automatically restored when tmux is started. set -g @continuum-restore 'on' ## Theming (inspired by https://github.com/Who23/dots/blob/21976e76644d8d9261ebdcf61733d2181a1612eb/tmux.conf) set -g status-bg black set -g status-fg white # set -g status-right "Continuum status: #{continuum_status}" set -g @prefix_highlight_fg 'black' set -g @prefix_highlight_bg 'yellow' set -g @prefix_highlight_output_prefix ' ' set -g @prefix_highlight_output_suffix ' ' set -g status-right "#{prefix_highlight}" set -g status-left "#{prefix_highlight}" set -g status-justify centre set -g window-status-current-format "#[fg=yellow]#[fg=black]#[bg=yellow]#I #W#[fg=yellow]#[bg=black] " set -g window-status-format "#[fg=brightblack]#[fg=white]#[bg=brightblack]#I #W#[fg=brightblack]#[bg=black] " # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run -b '~/.config/tmux/plugins/tpm/tpm'