mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 16:12:48 +00:00
feat(defaults): improve :grep defaults #28545
Based on feedback from #28324, pass -H and -I to regular grep (available on all platforms officially supported by Neovim), and only pass -uu to ripgrep. This makes :grep ignore binary files by default in both cases.
This commit is contained in:
committed by
GitHub
parent
83635e4e3d
commit
513fc46195
@@ -560,9 +560,8 @@ end
|
||||
do
|
||||
--- 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')
|
||||
-- Use -uu to make ripgrep not check ignore files/skip dot-files
|
||||
vim.o.grepprg = 'rg --vimgrep -uu '
|
||||
vim.o.grepformat = '%f:%l:%c:%m'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user