mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
feat(defaults): use ripgrep (rg) for 'grepprg' if available
This commit is contained in:
committed by
Christian Clason
parent
fe4583127f
commit
20b38677c2
@@ -496,3 +496,11 @@ if tty then
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- Default 'grepprg' to ripgrep if available.
|
||||
if vim.fn.executable('rg') == 1 then
|
||||
-- Match :grep default, otherwise rg searches cwd by default
|
||||
-- Use -uuu to make ripgrep not do its default filtering
|
||||
vim.o.grepprg = 'rg --vimgrep -uuu $* ' .. (vim.fn.has('unix') == 1 and '/dev/null' or 'nul')
|
||||
vim.o.grepformat = '%f:%l:%c:%m'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user