diff options
author | Luna Saphie Mittelbach <lunarlambda@gmail.com> | 2024-04-14 12:54:10 +0200 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2024-04-16 19:21:02 +0200 |
commit | 20b38677c22b0ff19ea54396c7718b5a8f410ed4 (patch) | |
tree | d325a3d445e27e9fdb13cb24cd7b54d9bbfbdc6e /src | |
parent | fe4583127f0aaf631b05ad3dff7ebb0126314cf2 (diff) | |
download | rneovim-20b38677c22b0ff19ea54396c7718b5a8f410ed4.tar.gz rneovim-20b38677c22b0ff19ea54396c7718b5a8f410ed4.tar.bz2 rneovim-20b38677c22b0ff19ea54396c7718b5a8f410ed4.zip |
feat(defaults): use ripgrep (rg) for 'grepprg' if available
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/options.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/nvim/options.lua b/src/nvim/options.lua index 1d81b570b7..c22bce04c8 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -3368,6 +3368,8 @@ return { Format to recognize for the ":grep" command output. This is a scanf-like string that uses the same format as the 'errorformat' option: see |errorformat|. + + If ripgrep ('grepprg') is available, this option defaults to `%f:%l:%c:%m`. ]=], full_name = 'grepformat', list = 'onecomma', @@ -3382,8 +3384,7 @@ return { condition = 'MSWIN', if_false = 'grep -n $* /dev/null', if_true = 'findstr /n $* nul', - doc = [["grep -n ", - Unix: "grep -n $* /dev/null"]], + doc = [[see below]], }, desc = [=[ Program to use for the |:grep| command. This option may contain '%' @@ -3401,6 +3402,16 @@ return { apply equally to 'grepprg'. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. + This option defaults to: + - `rg --vimgrep -uuu $* ...` if ripgrep is available (|:checkhealth|), + - `grep -n $* /dev/null` on Unix, + - `findstr /n $* nul` on Windows. + Ripgrep can perform additional filtering such as using .gitignore rules + and skipping hidden or binary files. This is disabled by default (see the -u option) + to more closely match the behaviour of standard grep. + You can make ripgrep match Vim's case handling using the + -i/--ignore-case and -S/--smart-case options. + An |OptionSet| autocmd can be used to set it up to match automatically. ]=], expand = true, full_name = 'grepprg', |