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

almost exact search, matching lines navigation, better editing support (similar to readline) #234

Closed
balta2ar opened this issue May 29, 2020 · 4 comments

Comments

@balta2ar
Copy link

Hello. Here are a few features in random order that I personally find missing but which could greatly improve user experience IMO. I'm not sure if I should have created an issue for each one of them, let me know if that works better for you, I can do that and split them. Disclaimer: all this features that I'm talking about below I tried in --only-folders mode (I don't know whether it's important though).

  1. An option to always use exact search. I found in the docs (https://dystroy.org/broot/documentation/tricks/#going-from-a-fixed-search-to-an-exact-one) that I can type / to make the search exact, but I literally never ever use fuzzy search so I'd prefer to not type / it everytime. Something similar to fzf --exact.
  2. Almost exact search. Now the exact search is actually too exact. I wish I could have something in the middle. For example, when I have a query mongo client, I'd like both strings mongo-best-client and my-mongo-client to match and be in the output. Basically, this is how fzf --exact search works.
  3. :focus_next, :focus_prev. I'd like to navigate quickly between matching lines with a shortcut, e.g. Tab/Shift tab to go to the next/prev matching line. Currently I can only press Up/Down arrow to skip non-matching folders (but which are parents to matching folders)
  4. better readline support. What I mean is that I miss the following shortcuts a lot: alt-backspace to delete previous word, alt-d delete following word, alt-b/alt-f go to previous/next word, alt-e go to the end of the word, ctrl-a/ctrl-e go to beginning/end of the line.

I'm currently trying to see whether broot could be a good companion and addition to fzf's alt-c (https://github.com/junegunn/fzf#key-bindings-for-command-line), so that's where most of my inspiration comes from.

@Canop
Copy link
Owner

Canop commented May 29, 2020

There are a lot of things here, which makes the issue hard to action. Most of it would maybe have been better on the chat. I'll try to answer in the same format.

  1. and 2. I note what you say in 1 & 2 but do you really have cases where you have less good results with the fuzzy search ?

  2. I can reintroduce the :select_previous and :select_next verbs (I removed them because they felt useless) but the tab key is reserved for completion so you'd have to choose other keys.

  3. This is interesting. I create a dedicated issue: Way to add input edition shortcuts #235

@balta2ar
Copy link
Author

balta2ar commented Jun 2, 2020

  1. and 2. Yes, all the time. I was a huge champion of fuzzy mode in the beginning but after a while with practice it came to me that my queries are more "efficient" if they are strict, so I switched to exact search with fzf and never looked back (see my 4-year-old comment: Revising ranking algorithm junegunn/fzf#638 (comment)).

  2. Sounds good, except for the tab key. Can it be made configurable as well? Tab feels like a natural shortcut to jump between matches.

@Canop
Copy link
Owner

Canop commented Jun 3, 2020

Regarding the type of search: I'm currently working on a new input pattern syntax. I don't want to communicate on it today but you might be satisfied. As I'll need testers for that branch I'd like you to register here.

Tab is also natural for completion. What could probably be done is to have tab available for shortcuts when there's no verb invocation in the input (i.e. when the input only contains a search pattern) because tab completion only applies to verbs and paths.

@balta2ar
Copy link
Author

balta2ar commented Jun 3, 2020

testers for that branch

I subscribed to that issue.

have tab available for shortcuts

Sounds good!

@Canop Canop closed this as completed in f1972b3 Jun 6, 2020
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