tmux/tmux: refactor to use source files
- plugins -> $PSOXIZSH/tmux/plugins.conf - vim integration -> $PSOXIZSH/tmux/fragment/vim-movement.conf We also allow the user to include personal settings via ~/.config/tmux/{early,late}.conf which can include any of the fragments we collect! C
This commit is contained in:
parent
fbf825aef8
commit
d16b5c69ca
|
@ -1,32 +1,12 @@
|
|||
# Plugins
|
||||
set-environment -g TMUX_PLUGIN_MANAGER_PATH "$TMUX_PLUGINS"
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
|
||||
set -g @prefix_highlight_prefix_prompt 'Pre'
|
||||
set -g @prefix_highlight_fg 'yellow'
|
||||
set -g @prefix_highlight_bg 'default'
|
||||
set -g @plugin 'tmux-plugins/tmux-copycat'
|
||||
set -g @plugin 'tmux-plugins/tmux-yank'
|
||||
if "test -f ~/.config/tmux/plugins.conf" {
|
||||
source-file ~/.config/tmux/plugins.conf
|
||||
}
|
||||
|
||||
# Integration with vim-tmux-navigator & fzf
|
||||
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
||||
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
||||
is_fzf="ps -o state= -o comm= -t '#{pane_tty}' \
|
||||
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'"
|
||||
bind -n C-h run "($is_vim && tmux send-keys C-h) \
|
||||
|| tmux select-pane -L"
|
||||
bind -n C-j run "($is_vim && tmux send-keys C-j) \
|
||||
|| ($is_fzf && tmux send-keys C-j) \
|
||||
|| tmux select-pane -D"
|
||||
bind -n C-k run "($is_vim && tmux send-keys C-k) \
|
||||
|| ($is_fzf && tmux send-keys C-k) \
|
||||
|| tmux select-pane -U"
|
||||
bind -n C-l run "($is_vim && tmux send-keys C-l) \
|
||||
|| tmux select-pane -R"
|
||||
bind-key -T copy-mode-vi 'C-h' select-pane -L
|
||||
bind-key -T copy-mode-vi 'C-j' select-pane -D
|
||||
bind-key -T copy-mode-vi 'C-k' select-pane -U
|
||||
bind-key -T copy-mode-vi 'C-l' select-pane -R
|
||||
if "test -f ~/.config/tmux/early.conf" {
|
||||
source-file ~/.config/tmux/early.conf
|
||||
}
|
||||
|
||||
set-option -g prefix C-a
|
||||
set-option -g set-titles on
|
||||
|
@ -69,5 +49,9 @@ bind - last-window \; swap-pane -s tmux-zoom.0 \; kill-window -t tmux-zoom
|
|||
# prefix + / to search
|
||||
bind-key / copy-mode \; send-key ?
|
||||
|
||||
if "test -f ~/.config/tmux/late.conf" {
|
||||
source-file ~/.config/tmux/late.conf
|
||||
}
|
||||
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run -b "$TMUX_PLUGINS/tpm/tpm"
|
||||
|
|
Loading…
Reference in New Issue