Add :Rg[!] command

:Rg <STRING> grep for the string and fuzzy find the results, bang to
enable regex in search term
This commit is contained in:
Kenneth Benzie 2024-04-06 15:39:43 +01:00
parent ba4e6dc233
commit d92a312992

View File

@ -83,3 +83,13 @@ end, {
-- TODO: :Chmod
-- TODO: :Mkdir
-- :Rg <STRING> grep for the string and fuzzy find the results, bang to enable
-- regex in search term
vim.api.nvim_create_user_command('Rg', function(opts)
local grep_opts = { search = opts.args }
if opts.bang then
grep_opts['use_regex'] = true
end
require('telescope.builtin').grep_string(grep_opts)
end, { bang = true, nargs = '*' })