From 513fc461957f370f9e89b3cfd56cb03a816d6941 Mon Sep 17 00:00:00 2001 From: Luna Saphie Mittelbach Date: Sun, 28 Apr 2024 18:00:48 +0200 Subject: 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. --- runtime/lua/vim/_defaults.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'runtime/lua/vim/_defaults.lua') diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua index e9575c0e1e..7166f7a23c 100644 --- a/runtime/lua/vim/_defaults.lua +++ b/runtime/lua/vim/_defaults.lua @@ -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 -- cgit