Skip to content
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

Allow configuring the keybinding prefix #55

Open
kyanagi opened this issue Oct 22, 2024 · 2 comments
Open

Allow configuring the keybinding prefix #55

kyanagi opened this issue Oct 22, 2024 · 2 comments

Comments

@kyanagi
Copy link

kyanagi commented Oct 22, 2024

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.
kyanagi@8ef4a8c
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.

@junegunn
Copy link
Owner

junegunn commented Oct 25, 2024

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.

@kyanagi
Copy link
Author

kyanagi commented Oct 26, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants