Allow configuring the keybinding prefix
fzf-git uses C-g as the keybinding prefix, but I would like to keep C-g for its original use.
How about making the keybinding prefix configurable?
For zsh, I have implemented a way to set the prefix using an environment variable FZF_GIT_KEY_PREFIX, as shown below.
https://github.com/kyanagi/fzf-git.sh/commit/8ef4a8cb86e9874a35bd58b5302c1b321f7f151b
I intended to implement this for bash as well, but I couldn't get it to work, so the implementation is currently limited to zsh only.
Unfortunately, bash and zsh use different notations for key chords. In this case, \C-g vs. ^g. This makes it impossible to provide a simple, consistent option variable we can use across bash and zsh.
# Works in bash, but not in zsh
export FZF_GIT_PREFIX='\C-g'
# The opposite
export FZF_GIT_PREFIX='^g'
🫤
This is probably a non-issue, because few people switch between the two shells, but still, not ideal.
Yes, I was aware that the configuration strings differ between bash and zsh.
I believe the options are either to prepare a single environment variable and ask users to configure it based on their choice of either bash or zsh, or to provide separate environment variables for bash and zsh. If neither option is acceptable, we would have to give up on implementing it.
fyi, this might be what ur looking for: https://github.com/junegunn/fzf-git.sh/issues/16#issuecomment-2905645909