Telescope extension gives user the ability to pick and choose ripgrep options on the fly.
showcase.mp4
With lazy.nvim:
{
"blanktiger/telescope-rg.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
config = function()
require("telescope").load_extension("ripgrep")
end,
},
opts = {
-- your config goes here
}
}
You can configure two pickers that specialize in two different things:
-- FILE SEARCHER
vim.keymap.set("n", "<leader>sf", function()
require("telescope").extensions.ripgrep.ripgrep_files({})
end, {})
-- TEXT SEARCHER
vim.keymap.set("n", "<leader>st", function()
require("telescope").extensions.ripgrep.ripgrep_text({})
end, {})
-- TEXT SEARCHER IN DIR OF CURRENTLY OPEN FILE
vim.keymap.set("n", "<leader>sa", function()
require("telescope").extensions.ripgrep.ripgrep_text({
curr_file_dir = true,
})
end, {})