-
Notifications
You must be signed in to change notification settings - Fork 79
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
Overhaul custom key bindings to be a first-class feature #172
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PatrickF1
force-pushed
the
key-bind-function
branch
3 times, most recently
from
June 10, 2021 21:29
2bf5c33
to
a4a2121
Compare
PatrickF1
force-pushed
the
key-bind-function
branch
from
June 10, 2021 21:37
a4a2121
to
554522b
Compare
PatrickF1
force-pushed
the
key-bind-function
branch
2 times, most recently
from
June 10, 2021 23:41
bae1392
to
f5b0af7
Compare
PatrickF1
force-pushed
the
key-bind-function
branch
from
June 11, 2021 00:21
f5b0af7
to
8d0c117
Compare
PatrickF1
force-pushed
the
key-bind-function
branch
from
June 11, 2021 00:23
8d0c117
to
5725749
Compare
PatrickF1
force-pushed
the
key-bind-function
branch
3 times, most recently
from
June 11, 2021 05:35
bc35d42
to
9ea27d4
Compare
PatrickF1
force-pushed
the
key-bind-function
branch
from
June 11, 2021 16:18
9ea27d4
to
5cb36f6
Compare
PatrickF1
force-pushed
the
key-bind-function
branch
from
June 11, 2021 16:21
3eff8c0
to
f8994dc
Compare
PatrickF1
force-pushed
the
key-bind-function
branch
from
June 11, 2021 16:22
f8994dc
to
31e6181
Compare
PatrickF1
changed the title
Overhaul key binding mechanism
Overhaul custom key bindings to be a first-class feature
Jun 11, 2021
PatrickF1
added a commit
that referenced
this pull request
Jun 12, 2021
forgot to remove it in #172 when I overhauled the custom key binding mechanism
PatrickF1
added a commit
that referenced
this pull request
Jun 12, 2021
I forgot to remove it in #172 when I overhauled the custom key binding mechanism. Also shortened the section on customize key binding.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Setting custom key bindings is horrible experience. It's time to give it a make over!
Background and motivation
fzf.fish ships with default key bindings that are mnemonic and have minimal conflicts with existing fish key bindings. However, for users who want to change them, the process of customizing them is frustrating and confusing at best. This frustration has culminated in a steady stream of issues, discussions, PRs, and Wiki sections around key bindings (#17, #89, #99, #108, #103, #153, #162, Wiki section). Here are the shortcomings of making custom bindings DIY:
fzf_fish_custom_keybindings
is set, the plugin provides zero assistance to the user when it comes to installing the custom bindings. Users have to studyconfig/fzf.fish
,bind
documentation, and maybe even learn some fish syntax to learn how to set their own key bindings. This is a quite daunting task. Furthermore, users have to reference functions clearly denoted private (__fzf_search_*
)., which feels and use hacky. Ideally,the plugin does not require typical users to dive into its code and will abstract private functions away completely.
fzf_fish_custom_keybindings
is all or nothing; users have to opt out of ALL default key bindings and re-bind them themselves even if they only want to change one. This is tedious, verbose, and unwieldy. A good plugin should allow tweaking the key binding while maintaining the rest of the defaults.fzf_fish_custom_keybindings
has to be set beforeconfig/fzf.fish
is executed, it has to be created as a universal variable. Unfortunately, universal variables are a very confusing point for new fish users.config.fish
. This makes it more difficult for one'sfzf.fish
configuration to be checked into git.As the plugin author, I have also felt the pain of working around this DIY custom binding mechanism:
fzf_fish_custom_keybindings
has an annoying typo: key binding is two words, not one.The new solution
A new function called
fzf_configure_bindings
solves or mitigates all of the aforementioned problems. It:--directory
controls the search directory key binding). Bindings can be overridden or, if the user doesn't want to use the feature, even disabled.