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

Repeated filtering like in nnn #2385

Open
2 of 3 tasks
enoryw opened this issue Feb 23, 2025 · 2 comments
Open
2 of 3 tasks

Repeated filtering like in nnn #2385

enoryw opened this issue Feb 23, 2025 · 2 comments
Labels
feature New feature request

Comments

@enoryw
Copy link

enoryw commented Feb 23, 2025

yazi --debug output

N/A

Please describe the problem you're trying to solve

filter was implemented as a feature supported by nnn/lf/ranger. At least with nnn as a default binding and behavior, you can further narrow down searches, e.g. (where / is bound to filter and what follows is the string to filter):

/foo: narrowed list of files containing foo, then:
/bar: narrowed list of files containing bar from the already narrowed list of files containing foo

ESC to exit the filter, Ctrl-L to redraw (refresh) to the screen, going back to the unfiltered state.

I find this workflow to be much faster than search because:

  • Unlike filter, search does not provide live feedback
  • filter is usually enough and requires little thought--just type substrings. It's more intuitive, you don't have to consider the order of foo and bar. It's meant to be fast and convenient, whereas search is obviously more powerful using regex but requires more work and thought
  • searching the filesystem is expensive and in-efficient when you're continuously adjusting to get the results vs. simply narrowing down a narrowed list with repeated filters

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

Currently, filter can only start over the filter from scratch, whether you're using filter or search you can't achieve above without more work and thought. Maybe a filter --smart --continue to insert the existing filter to a new filter.

Additional context

No response

Checklist

  • I have searched the existing issues/discussions
  • The latest nightly build doesn't already have this feature
@enoryw enoryw added the feature New feature request label Feb 23, 2025
Copy link

Hey @enoryw, I noticed that you did not correctly follow the issue template. Please ensure that:

  • The requested feature does not exist in the newest nightly build.
  • The debug information (yazi --debug) is updated for the newest nightly.
  • All required fields in the checklist have been checked.

Issues with needs info will be marked ready once edited with the proper content, or closed after 2 days of inactivity.

@csswright
Copy link

ESC to exit the filter, Ctrl-L to redraw (refresh) to the screen, going back to the unfiltered state.

Correction: while in the filter (in a /string), Ctrl-l toggles between last filter and currently filtered list. ESC to exit the filter then Ctrl-l will redraw (refresh) to the unfiltered (and updated) list or / to repeated filter on the existing filtered list.

But yes, fully agree, this feature is a gem and makes working with a TUI file manager actually feel natural. I find even in a long list of items, getting intended results is easy with the context of instant feedback based on search query. E.g. /res, ESC, /nar ESC, /xt to get to this is the result im narrowing for.txt with instant feedback as the list dwindles for better narrowing, along with the possibility to Ctrl-l it at any part of the filtering to start from the previous step again and narrow with a different filter. This is often typed out with no pauses in keystrokes or counting of items thanks to instant feedback (unlike find, which I don't use because it requires more conscious interaction and along with lack of instant feedback makes the workflow slower).

`

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

No branches or pull requests

3 participants