Closed Jelenkee closed 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
?
Ok. Maybe the idea with directly fallbacking to another tool isn't the best solution.
Other ideas:
search find
/search grep
as valid commandssearch files
/search content
(names could be better) which looks if fd exists and if not, fallbacks to find
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: )
In this case, I don't think it's necessary to add them:
find
and grep
commands would create overlapping functionality, and we'd have to explain the differences in the documentation, along with the dependencies needed for each command. Plus, we can't just say "fd is used for filename search" in the dependency list—we'd have to say "fd is used for search fd
", which would be even more confusing.rg
has a --json
option to output results in JSON, which Yazi could parse to enable highlighting in the preview pane (similar to what telescope.nvim
does). But I'm not sure if grep
can output JSON, and if it can't, we'd have to find another solution, which would add unnecessary maintenance costs.find
and grep
would only make things easier for Unix users, but they'd still be a problem for Windows users—or maybe even worse. fd
and rg
both offer Windows binaries, but I'm not sure there's a reliable way to install grep
and find
on Windows, which would introduce new cross-platform issues.fd
and rg
already, leading to a bad user experience. Implementing a search tool isn't as simple as it sounds—here are some of the technical details behind rg
(https://blog.burntsushi.net/ripgrep/), and after reading them, I got a headache.For these reasons, I'm closing this issue.
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.
yazi --debug
outputPlease describe the problem you're trying to solve
Hi, I wondered why
ripgrep
andfd
are supported out of the box andgrep
andfind
are not though the latter are way more common.Can you use them as a fallback when
ripgrep
orfd
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
andfind
are supported out of the box without an external pluginAdditional context
No response
Validations