Skip to content

Add fuzzy finder behavior to filter functionality #129

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

Closed
cseickel opened this issue Feb 6, 2022 · 3 comments
Closed

Add fuzzy finder behavior to filter functionality #129

cseickel opened this issue Feb 6, 2022 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@cseickel
Copy link
Contributor

cseickel commented Feb 6, 2022

This is probably related to #116. I find myself naturally wanting to use Up/Down keys when filtering the tree to select files in the search results, and I am annoyed when it doesn't do anything. I am going to change that by adding a "fuzzy finder mode" option which would:

  1. Add mappings to the filter input so that up/down (and C-j/C-k C-p/C-n) move the tree's focused node up and down.
  2. Change the <enter> key behavior so that whatever file is currently focused is opened and the filter is cleared

This makes the functionality closer to what Telescope and other fuzzy finders do.

The big question for anyone that reads this is: Should this just be the new default or should it be a new option that is opted into?

@cseickel cseickel added enhancement New feature or request question Further information is requested labels Feb 6, 2022
@cseickel cseickel pinned this issue Feb 6, 2022
@nyngwang
Copy link

nyngwang commented Feb 6, 2022

FYI: My current way of searching the target quickly is via the filter and the vim-builtin / to search exactly what I want. And this is enough for me. (I also set C-j, C-k to move my cursor faster)

The current problem I found with the existing filter is that:

  • I cannot use <C-W> to backward-delete words (which I do a lot in my Terminal) in the input field of the current filter window.
  • The drawback of builtin / is that it's not a fuzzy finder, so I cannot type lau in the following demo to search files with extension .lua.
demo_filter_._builtin.mov

@cseickel
Copy link
Contributor Author

cseickel commented Feb 6, 2022

I'm hoping that the new fuzzy finder mode I am about to commit will cut out the second step of using the built in / after using the Neo-tree filter. What I am unsure about is whether most people would prefer this be the new default or if some people liked the way it worked before, where it just filtered and then stayed filtered. My current thinking is that they can use the normal filter command when they want the filter to stick, and only use filter_as_you_type in fuzzy finder mode.

As far as Ctwl-w, the search popup is just a normal buffer and not a terminal, so the usual vim commands apply. If you want C-w to act as a delete word command in insert mode, just add an insert mode mapping.
https://stackoverflow.com/questions/32154641/vim-how-to-delete-a-word-in-the-insert-mode

@cseickel
Copy link
Contributor Author

cseickel commented Feb 6, 2022

This has been added to main. I decided to add it as a new command called fuzzy_finder, but make that the default mapping for the / key. hopefully this strikes the right balance between having a better default while not annoying existing users that may have liked the old functionality. At the very least, it's easy to switch back for people that don't like it.

@cseickel cseickel unpinned this issue Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants