Live grep args picker for telescope.nvim.
It enables passing arguments to the grep command, rg
examples:
--no-ignore foo
"foo bar" bazdir
Add telescope-live-grep-args.nvim
as telescope.nvim
dependency, e.g.:
use {
"nvim-telescope/telescope.nvim",
requires = {
{ "nvim-telescope/telescope-live-grep-args.nvim" }
}
}
Load the extension
require("telescope").load_extension("live_grep_args")
Then call or map this command
:lua require("telescope").extensions.live_grep_args.live_grep_args()
prompt | args |
---|---|
foo bar |
foo bar |
"foo bar" baz |
foo bar , baz |
--no-ignore "foo bar |
--no-ignore , foo bar |
If the prompt value does not begin with '
, "
or -
the entire prompt is treatet as a single argument.
This behaviour can be turned off by setting the auto_quoting
option to false
.
local telescope = require("telescope")
telescope.setup {
extensions = {
live_grep_args = {
auto_quoting = true, -- enable/disable auto-quoting
}
}
}
- Clone plenary.nvim next to this repo
make test
Based on the idea of this pull request.