2020-11-30 10:31:22 +00:00
|
|
|
bind c new-window -c "#{pane_current_path}"
|
|
|
|
|
2022-05-10 18:32:18 +00:00
|
|
|
# Needed for NVIM
|
|
|
|
set-option -sg escape-time 10
|
|
|
|
|
|
|
|
# History
|
|
|
|
set-option -g history-limit 50000
|
|
|
|
|
|
|
|
# Vim mode
|
2020-11-30 10:31:22 +00:00
|
|
|
set -g status-keys vi
|
|
|
|
setw -g mode-keys vi
|
|
|
|
|
|
|
|
bind | split-window -h -c "#{pane_current_path}"
|
|
|
|
bind - split-window -v -c "#{pane_current_path}"
|
|
|
|
|
|
|
|
# https://stackoverflow.com/questions/18600188/home-end-keys-do-not-work-in-tmux
|
|
|
|
bind -n Home if-shell "$is_vim" "send-keys Escape 'OH'" "send-key C-a"
|
|
|
|
bind -n End if-shell "$is_vim" "send-keys Escape 'OF'" "send-key C-e"
|
|
|
|
|
|
|
|
set -g default-terminal "tmux-256color"
|
2021-04-06 19:56:10 +00:00
|
|
|
set -ag terminal-overrides ",*256col*:colors=256:Tc,alacritty:Tc"
|
2020-11-30 10:31:22 +00:00
|
|
|
|
|
|
|
# Ms modifies OSC 52 clipboard handling to work with mosh, see
|
|
|
|
# https://gist.github.com/yudai/95b20e3da66df1b066531997f982b57b
|
|
|
|
set -ag terminal-overrides "vte*:XT:Ms=\\E]52;c;%p2%s\\7,xterm*:XT:Ms=\\E]52;c;%p2%s\\7"
|
2021-04-06 19:56:10 +00:00
|
|
|
# https://github.com/alacritty/alacritty/issues/3037
|
|
|
|
set -ag terminal-override ',alacritty:Ms=\E]52;c;%p2%s\007'
|
2020-11-30 10:31:22 +00:00
|
|
|
|
|
|
|
# enable OSC 52 clipboard
|
|
|
|
set -g set-clipboard on
|
|
|
|
|
|
|
|
set -g mouse on
|
2021-04-06 19:56:10 +00:00
|
|
|
set -g focus-events on
|
2020-11-30 10:31:22 +00:00
|
|
|
|
|
|
|
unbind-key -T copy-mode-vi v
|
|
|
|
unbind-key -T copy-mode-vi V
|
|
|
|
unbind-key -T copy-mode-vi y
|
|
|
|
unbind-key -T copy-mode-vi Enter
|
|
|
|
unbind-key p
|
|
|
|
# Begin selection in copy mode.
|
|
|
|
bind-key -T copy-mode-vi 'v' send -X begin-selection
|
|
|
|
# Begin rectangle selection in copy mode.
|
|
|
|
bind-key -T copy-mode-vi 'V' send -X rectangle-toggle
|
|
|
|
# Yank selection in copy mode.
|
|
|
|
bind-key -T copy-mode-vi 'y' send -X copy-selection
|
|
|
|
bind-key -T copy-mode-vi Enter send -X copy-selection
|
|
|
|
bind p paste-buffer
|
2021-03-21 07:23:10 +00:00
|
|
|
|
2021-03-21 12:39:42 +00:00
|
|
|
# Theme
|
|
|
|
|
|
|
|
# Default colors
|
|
|
|
set-option -g status-style fg=colour238,bg=colour255
|
|
|
|
|
|
|
|
# Window titles
|
|
|
|
set-window-option -g window-status-style fg=default,bg=default
|
|
|
|
set-window-option -g window-status-current-style fg=black,bold,bg=default
|
|
|
|
set-window-option -g window-status-activity-style fg=default,noreverse,bg=default
|
|
|
|
|
|
|
|
# Pane borders
|
|
|
|
set-option -g pane-border-style fg=colour250,bg=default
|
|
|
|
set-option -g pane-active-border-style fg=colour75,bg=default
|
2021-03-21 07:23:10 +00:00
|
|
|
|
2021-03-21 12:39:42 +00:00
|
|
|
# Message text
|
|
|
|
set-option -g message-style fg=colour75,bg=default
|
|
|
|
set-option -g message-command-style fg=colour35,bg=default
|
|
|
|
|
|
|
|
# Copy mode
|
|
|
|
set-window-option -g mode-style fg=default,bg=colour250
|
|
|
|
|
|
|
|
# Clock mode
|
|
|
|
set-window-option -g clock-mode-colour colour75
|
|
|
|
set-window-option -g clock-mode-style 24
|
|
|
|
|
|
|
|
# Plugins
|
|
|
|
set-option -g @prefix_highlight_fg 'colour255'
|
|
|
|
set-option -g @prefix_highlight_bg 'colour75'
|
|
|
|
set-option -g @prefix_highlight_copy_mode_attr 'fg=colour255,bg=colour176'
|
2021-03-21 07:23:10 +00:00
|
|
|
|
2021-04-06 19:56:10 +00:00
|
|
|
## TMUX Plugins
|
|
|
|
if "test ! -d ~/.tmux/plugins/tpm" \
|
|
|
|
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
|
|
|
|
|
|
|
|
set -g @plugin 'tmux-plugins/tpm'
|
|
|
|
|
|
|
|
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
|
|
|
set -g @resurrect-strategy-vim 'session'
|
|
|
|
|
|
|
|
run '~/.tmux/plugins/tpm/tpm'
|