junegunn / junegunn/fzf-git.sh

Keybindings do not work in case one uses zsh-vi-mode plugin

Open
#23 6 comments 4 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
1.2k
Forks
97
PR merge metrics
No merged PRs in 30d

Description

Hi,
thank you for creating this amazing tool: fzf has been an absolute game-changer for me.

I had trouble in making the keybindings of fzf-git work after having installed [`zsh-vi-mode`](https://github.com/jeffreytse/zsh-vi-mode) plugin.
I solved this issue by re-creating the keybindings according to what is advised in the [`zsh-vi-mode` README](https://github.com/jeffreytse/zsh-vi-mode#execute-extra-commands), namely by doing:
```bash
# Set keybindings for zsh-vi-mode insert mode
function zvm_after_init() {
zvm_bindkey viins "^P" up-line-or-beginning-search
zvm_bindkey viins "^N" down-line-or-beginning-search
for o in files branches tags remotes hashes stashes each_ref; do
eval "zvm_bindkey viins '^g^${o[1]}' fzf-git-$o-widget"
eval "zvm_bindkey viins '^g${o[1]}' fzf-git-$o-widget"
done
}
# Set keybindings for zsh-vi-mode normal and visual modes
function zvm_after_lazy_keybindings() {
for o in files branches tags remotes hashes stashes each_ref; do
eval "zvm_bindkey vicmd '^g^${o[1]}' fzf-git-$o-widget"
eval "zvm_bindkey vicmd '^g${o[1]}' fzf-git-$o-widget"
eval "zvm_bindkey visual '^g^${o[1]}' fzf-git-$o-widget"
eval "zvm_bindkey visual '^g${o[1]}' fzf-git-$o-widget"
done
}
```

I guess there is nothing to do from your side, maybe you could consider adding a little statement on the README.

Thanks.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.