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

[FEATURE] multicharacter trigger sequences (keybindings) #2466

Open
6 of 10 tasks
githorse opened this issue Apr 24, 2021 · 0 comments
Open
6 of 10 tasks

[FEATURE] multicharacter trigger sequences (keybindings) #2466

githorse opened this issue Apr 24, 2021 · 0 comments

Comments

@githorse
Copy link

  • I have read through the manual page (man fzf)
  • I have the latest version of fzf
  • I have searched through the existing issues

Info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • bash
    • zsh
    • fish

Idea

Keybindings are obviously super useful, but they are finite and sometimes hard to remember -- great for power users writing their own fzf scripts, less so for novices using somebody else's fzf-based widget. What about binding to multicharacter sequences as well?

--bind '[pizza:]:reload(pizza_menu),[taco:]:reload(taco_menu)'

Now I can type > pizza: hawaiian to narrow my search list to only pizzas.

(See my related issue on dynamic query formatting/rewriting for a more fleshed-out example mimicking the omnibar "search engine" functionality of Firefox/Chrome (and probably all browsers nowadays) and Alfred/Albert.)

There are some kinks here to be sure, even from my layman's perspective:

  • What do you do with the trigger sequence in the query once it's been fired? Leave it? Delete it? Move it into the prompt?
  • If the trigger stays in the query after it's typed, does it fire on every change? Just once?
  • What if the trigger is in the middle of another word? (Presumably, easiest thing is to avoid this problem by require the trigger at the beginning of the query separated by whitespace.)

I have no idea what implementation challenges this might bring up, but this seems like it could be pretty cool. Certainly it would make the widget I have in mind super slick.

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

1 participant