defaults: use ripgrep (rg) for :grep if available #28296
Replies: 2 comments 6 replies
-
Nah, very unlikely. We don't wanna add dependencies unless we absolutely have to and platform-specific solutions aren't desirable. As for defaulting to ripgrepnif it exists: that could work, although unsure about what other people thinks of it. If the effort is small you could make a PR and let people say what they think of it. Proposals carry more weight if they come with an implementation. |
Beta Was this translation helpful? Give feedback.
-
Right. But we have other mechanisms to leverage, e.g. |
Beta Was this translation helpful? Give feedback.
-
I was playing with this idea the other day, and I would be happy to make a PR if people think this could be an accepted change.
For background, ripgrep is a faster grep written in Rust that's aimed at programmers and provides features like .gitignore support.
Many Neovim plugins like telescope.nvim and todo-comments.nvim already integrate with ripgrep out of the box for search support. Adopting this as a backwards-compatible alternative for :grep could be a great addition to Neovim's enhanced defaults.
I will probably publish this as a tiny plugin in the near future, but given how small and hands-off the entire thing is, I'm hopeful it could be considered as an inclusion into neovim core. So feedback about which functionality and default flags should be included are welcome.
At base, it's as simple as
Additionally, ripgrep supports a vim-style 'smartcase' flag, so searching could be adapted to vim's settings automatically:
If accepted, Neovim could even bundle ripgrep by default on Windows in the future, since it is dual-licensed under MIT and the UNLICENSE.EDIT: PR for the basic form of this is open #28324
Beta Was this translation helpful? Give feedback.
All reactions