added support keys.conf to tmux

This commit is contained in:
psox 2021-11-06 13:25:44 +00:00
parent 2b523a19f2
commit db33642b75
3 changed files with 19 additions and 13 deletions

View File

@ -13,19 +13,19 @@
# 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)?$'"
| 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-M-Left run "($is_vim && tmux send-keys C-h) \
|| tmux select-pane -L"
bind -n C-M-Down run "($is_vim && tmux send-keys C-j) \
|| ($is_fzf && tmux send-keys C-j) \
|| tmux select-pane -D"
bind -n C-M-Up run "($is_vim && tmux send-keys C-k) \
|| ($is_fzf && tmux send-keys C-k) \
|| tmux select-pane -U"
bind -n C-M-Right run "($is_vim && tmux send-keys C-l) \
|| tmux select-pane -R"
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'"
bind -n C-M-Left run "($is_vim && tmux send-keys C-M-Left) \
|| tmux select-pane -L"
bind -n C-M-Down run "($is_vim && tmux send-keys C-M-Down) \
|| ($is_fzf && tmux send-keys C-M-Down) \
|| tmux select-pane -D"
bind -n C-M-Up run "($is_vim && tmux send-keys C-M-Up) \
|| ($is_fzf && tmux send-keys C-M-Up) \
|| tmux select-pane -U"
bind -n C-M-Right run "($is_vim && tmux send-keys C-M-Right) \
|| tmux select-pane -R"
bind-key -T copy-mode-vi 'C-M-Left' select-pane -L
bind-key -T copy-mode-vi 'C-M-Down' select-pane -D
bind-key -T copy-mode-vi 'C-M-Up' select-pane -U

View File

@ -8,6 +8,10 @@ if "test -f ~/.config/tmux/early.conf" {
source-file ~/.config/tmux/early.conf
}
if "test -f ~/.config/tmux/keys.conf" {
source-file ~/.config/tmux/keys.conf
}
set-option -g prefix C-a
set-option -g set-titles on
set-window-option -g automatic-rename on

4
zshrc
View File

@ -168,7 +168,9 @@ then
[[ ! -f $TMUX_PATH/tmux.conf ]] && cp -r "$PSOXIZSH/tmux/tmux.conf" "$TMUX_PATH/tmux.conf"
[[ ! -f ~/.tmux.conf ]] && ln -s $PSOXIZSH/tmux/tmux.conf ~/.tmux.conf
[[ ! -f "$TMUX_PATH/plugins.conf" ]] && ln -vs "$PSOXIZSH/tmux/fragment/plugins.conf" "$TMUX_PATH/plugins.conf"
[[ "$USER" == "astemmet" ]] && [[ ! -f $TMUX_PATH/early.conf ]] && ln -vs "$PSOXIZSH/tmux/fragment/ctrl-alt-movement.conf" "$TMUX_PATH/early.conf"
[[ "$USER" == "astemmet" ]] && [[ ! -f $TMUX_PATH/keys.conf ]] && {
cp -v "$PSOXIZSH/tmux/fragment/ctrl-alt-movement.conf" "$TMUX_PATH/keys.conf"
}
export TMUX_PATH=$TMUX_PATH TMUX_PLUGINS="$TMUX_PATH/plugins" TMUX_CONFIG=~/.tmux.conf
fi