-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help wanted: CTRL-G CTRL-H keybinding conflicts with tmux #16
Comments
Oops; I found that it is not the zsh-bindkey issue,
|
One workaround here. To map a sequence keymap in tmux, one could do the following (e.g. CTRL-G CTRL-H):
However, its downside is that it will eat all the 'CTRL-g' as a prefix, so other commands like
or do some clever scripting as follows. (1) in your zshrc, we export an environment variable so that TMUX can fetch all the zsh keybindings prefixed with +# Export all the known keymaps with prefix CTRL-g so it can be mapped in tmux
+export FZF_GIT_BINDKEYS=$(bindkey -p '^g') (2) in tmux.conf: Add a # vim-tmux-navigator
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "send-keys C-l"
+run-shell '~/.tmux/fzf-git-tmux.sh' (3) #!/bin/zsh
# Define <CTRL-G ...> keymaps to make fzf-git-tmux work.
# see ~/.zshrc for export of $FZF_GIT_BINDKEYS
tmux bind-key -n -T root C-g send-keys C-g \; switch-client -T ctrl_g_mode
for i in $(echo $FZF_GIT_BINDKEYS); do
if [[ "$i" =~ "\"\^G([^\"]+)" ]]; then
local key=${match[1]/\^/C-}
tmux bind-key -T ctrl_g_mode "$key" send-keys C-g "$key"
fi
done
return 0; What this script does is:
The But one downside is |
Hello! Thanks for the great plugin.
I know this is more related to zsh or zsh keybinding rather than fzf-git per se, but I'm asking for help because many of the users may run into the same problem.
CTRL-G CTRL-H
for commit Hashes do not work in my environment, because it conflicts withCTRL-H
mappings:I pressed
^G^H
within theKEYTIMEOUT
limit (40 ms) but in this case the fzf-git widget does not appear. However,^G H
or other keys (e.g.,^G ^S
) works fine. In a similar vein,^G ^E
seems conflicting with^E
(end-of-line) but^G ^E
works OK. Any idea why^G ^H
is not working for me?This SuperUser thread seems relevant, but there is no working solution posted there (
KEYTIMEOUT
does not work).zsh: zsh 5.9 (arm-apple-darwin21.3.0)
The text was updated successfully, but these errors were encountered: