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 request for "find" aka jump to matching file/folder #81

Closed
teto opened this issue Aug 22, 2023 · 15 comments · Fixed by #104
Closed

feature request for "find" aka jump to matching file/folder #81

teto opened this issue Aug 22, 2023 · 15 comments · Fixed by #104
Labels
waiting on op Waiting for more information from the original poster
Milestone

Comments

@teto
Copy link

teto commented Aug 22, 2023

thanks for creating this ! I used to use ranger but was tempted by joshuto for the rust bonus but either choice had issues and I feel yazi has strong foundamentals and can become the best choice for me:

  • (image & text) preview by default !
  • it was the fastest when opening my 200GB /nix/store that joshuto and ranger have difficulty with. I believe it could be even better and refresh the listing dynamically (I still had to wait ~8 sec) but it's much better than the other two.

The feature I miss the most currently is "search" or "filter". In ranger/joshuto, I could type / to start typing a folder name and go to it. Maybe it's possible in yazi but I couldn't find how ?

NB: nitpicks: PageUp and PageDown are not bound byu default and when the prompt to quit appears asking for "yes or no", I think it should quit on "y" press while right now I had to press "Enter" too.

@Gajus84
Copy link

Gajus84 commented Aug 22, 2023

The feature I miss the most currently is "search" or "filter". In ranger/joshuto, I could type / to start typing a folder name and go to it. Maybe it's possible in yazi but I couldn't find how ?

There are two possibilities, provided you have the requirements installed. FD and ripgrep (rg). Those are executed with "s" and "S".

You can consult (https://github.com/sxyazi/yazi/tree/main/config/preset) for default keycodes.

I hope this is of help.

@teto
Copy link
Author

teto commented Aug 22, 2023

It did help: I've added

 	{ on = [ "<PageUp>" ], exec = "arrow -10" },
	{ on = [ "<PageDown>" ], exec = "arrow 10" },

to keymap.toml. Note that you have to copy the whole file as your ~/.config/yazi/keymap.toml does not get merged with the default one.

I've tried s and S but it's a bit different than ranger's as ranger's / starts jumping to the folder you type immediately without . It's faster.

@sxyazi
Copy link
Owner

sxyazi commented Aug 23, 2023

Hi, thanks for the appreciation! Yazi integrates fzf and rg as the "search" feature; what you're looking for is called "find", which is documented in Feature requests, and I'll implement it sometime in the near future.

It's true that there's a lot of optimization potential in Yazi, such as dynamically loading file metadata, putting file sorting into a separate blocking threads pool, etc. It's a matter of finding the performance bottlenecks and optimizing for them, but I'll probably need to install a Nix before I can do that 🤣

Regarding the last point, does "yes or no" refer to the prompt triggered by quitting while there are still tasks left to complete?

@teto
Copy link
Author

teto commented Aug 23, 2023

what you're looking for is called "find", which is documented in #51, and I'll implement it sometime in the near future.

cool ! let me know if you need testers

Regarding the last point, does "yes or no" refer to the prompt triggered by quitting while there are still tasks left to complete?

Yes that's exactly it. I am not sure what/how I created the tasks but the message mentioned those.

@teto teto changed the title how to search/filter feature request for "find" aka jump to matching file/folder Aug 23, 2023
@sxyazi sxyazi mentioned this issue Aug 23, 2023
59 tasks
@sxyazi
Copy link
Owner

sxyazi commented Aug 23, 2023

You can press w key (the default) to see the tasks in progress

@sxyazi sxyazi added this to the v0.1.5 milestone Aug 31, 2023
@sxyazi sxyazi mentioned this issue Sep 3, 2023
@sxyazi
Copy link
Owner

sxyazi commented Sep 3, 2023

Done by #104, please give it a try!

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Sep 3, 2023
@teto
Copy link
Author

teto commented Sep 5, 2023

I am not sure what you meant by "filter" in the PR but here is what I would like to have in yazi, live update of the selected item upon keypress (it's enabled with / in ranger):

Kooha-2023-09-06-00-08-33.webm

NB: Kooha only worked with a fullscreen capture in my setup.

@sxyazi
Copy link
Owner

sxyazi commented Sep 6, 2023

Oh, I think I understand what you mean now. I will see if this is complex and try to implement it.

@sxyazi
Copy link
Owner

sxyazi commented Sep 6, 2023

it was the fastest when opening my 200GB /nix/store that joshuto and ranger have difficulty with. I believe it could be even better and refresh the listing dynamically (I still had to wait ~8 sec) but it's much better than the other two.

You might be interested in #117 :)

@teto
Copy link
Author

teto commented Sep 6, 2023

first time I started cargo run -- /nix/store took the same time as 0.1.4 (around 10seconds), but on restarts, it took half of that like 5sec so I wonder if yazi has its cache or if it's a system one

@sxyazi
Copy link
Owner

sxyazi commented Sep 6, 2023

Currently, Yazi performs chunk pre-loading when the cursor is hovered.

I am still considering whether it should be extended to direct opening -- this depends on whether the effect is noticeable.

You can try cargo run -- /nix, then navigate to the store, and enter it to see the effect.

@teto
Copy link
Author

teto commented Sep 6, 2023

wow indeed I just tried it and it was instantaneous !!!! Never dreamed of it considering how slow ranger and joshuto were. I will get you champagne if you come to france ;)

@sxyazi
Copy link
Owner

sxyazi commented Sep 6, 2023

Haha, thanks for your testing! I'm curious, how long does it take now? I only created 100,000 empty files for testing locally, and they take up almost no space. I'm not sure how it would perform under the pressure of 200GB. I haven't even installed NixOS yet 🤣

@teto
Copy link
Author

teto commented Sep 6, 2023

it is faster than anything I can notice, so I would say <100ms.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
waiting on op Waiting for more information from the original poster
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants