sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
14.54k stars 331 forks source link

Support for grep and find #1410

Closed Jelenkee closed 1 month ago

Jelenkee commented 1 month ago

yazi --debug output

```sh ##### ↓↓↓ Paste the output here: ↓↓↓ ##### Yazi Version: 0.3.0 (VERGEN_IDEMPOTENT_OUTPUT 2024-08-03) Debug : false OS : linux-x86_64 (unix) Ya Version: 0.3.0 Emulator Emulator.via_env: ("xterm-256color", "") Emulator.via_csi: Ok(Unknown([])) Emulator.detect : Unknown([]) Adapter Adapter.matches: X11 Desktop XDG_SESSION_TYPE: Some("x11") WAYLAND_DISPLAY : None DISPLAY : Some(":0.0") SSH shared.in_ssh_connection: false WSL /proc/sys/fs/binfmt_misc/WSLInterop: false Variables SHELL : Some("/bin/bash") EDITOR : Some("micro") YAZI_FILE_ONE : None YAZI_CONFIG_HOME : None ZELLIJ_SESSION_NAME: None Text Opener default: Some(Opener { run: "${EDITOR:=vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true }) block : Some(Opener { run: "${EDITOR:=vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true }) tmux TMUX : false Version: No such file or directory (os error 2) Dependencies file : 5.45 ueberzugpp : No such file or directory (os error 2) ffmpegthumbnailer: 2.2.2 magick : 7.1.1-36 fzf : 0.54.0 fd : 10.1.0 rg : No such file or directory (os error 2) chafa : No such file or directory (os error 2) zoxide : No such file or directory (os error 2) 7z : 17.05 7zz : No such file or directory (os error 2) jq : 1.7.1 ```

Please describe the problem you're trying to solve

Hi, I wondered why ripgrep and fd are supported out of the box and grep and find are not though the latter are way more common.

Can you use them as a fallback when ripgrep or fd are not installed? Or add a config where one can choose which tool should be used for searchin files.

Would you be willing to contribute this feature?

Describe the solution you'd like

grep and find are supported out of the box without an external plugin

Additional context

No response

Validations

sxyazi commented 1 month ago

I didn't quite understand what you meant, are you meaning that when a user runs search rg and doesn't have rg installed, it should fallback to using grep instead? If so, how would you handle the differences in their parameters? For example, if a user passes search rg --args="--a --b", but --a and --b might only be valid with rg but not grep?

Jelenkee commented 1 month ago

Ok. Maybe the idea with directly fallbacking to another tool isn't the best solution.

Other ideas:

In the first place I don't want to add an additional tool to my machine for a basic feature like searching text in files when there is a tool installed OOTB on any Linux/BSD/MacOS which can be used for that use case (it might be a bit slower :wink: )

sxyazi commented 1 month ago

In this case, I don't think it's necessary to add them:

For these reasons, I'm closing this issue.

github-actions[bot] commented 1 week ago

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.