diff options
| author | Luna Saphie Mittelbach <lunarlambda@gmail.com> | 2024-04-28 18:00:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-28 09:00:48 -0700 |
| commit | 513fc461957f370f9e89b3cfd56cb03a816d6941 (patch) | |
| tree | 03098d5684503e0a5a145a63a69d2c0956aca7e5 /runtime/doc | |
| parent | 83635e4e3db9a99c128e84e79deb590da354215d (diff) | |
| download | rneovim-513fc461957f370f9e89b3cfd56cb03a816d6941.tar.gz rneovim-513fc461957f370f9e89b3cfd56cb03a816d6941.tar.bz2 rneovim-513fc461957f370f9e89b3cfd56cb03a816d6941.zip | |
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.
Diffstat (limited to 'runtime/doc')
| -rw-r--r-- | runtime/doc/news.txt | 3 | ||||
| -rw-r--r-- | runtime/doc/options.txt | 11 | ||||
| -rw-r--r-- | runtime/doc/vim_diff.txt | 3 |
3 files changed, 8 insertions, 9 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 4747ad5917..1da81e3422 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -407,7 +407,8 @@ The following changes to existing APIs or features add new behavior. correctly without it. (Use |gF| for filepaths suffixed with ":line:col"). • 'comments' includes "fb:•". • 'shortmess' includes the "C" flag. - • 'grepprg' defaults to using ripgrep if available. + • 'grepprg' uses the -H and -I flags for grep by default, + and defaults to using ripgrep if available. • |crn| in Normal mode maps to |vim.lsp.buf.rename()|. • |crr| in Normal and Visual mode maps to |vim.lsp.buf.code_action()|. • "gr" in Normal mode maps to |vim.lsp.buf.references()| |gr-default| diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 7b5e3a1c49..9e9c48e099 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2861,10 +2861,7 @@ A jump table for the options with a short description can be found at |Q_op|. line. The placeholder "$*" is allowed to specify where the arguments will be included. Environment variables are expanded |:set_env|. See |option-backslash| about including spaces and backslashes. - When your "grep" accepts the "-H" argument, use this to make ":grep" - also work well with a single file: >vim - set grepprg=grep\ -nH -< Special value: When 'grepprg' is set to "internal" the |:grep| command + Special value: When 'grepprg' is set to "internal" the |:grep| command works like |:vimgrep|, |:lgrep| like |:lvimgrep|, |:grepadd| like |:vimgrepadd| and |:lgrepadd| like |:lvimgrepadd|. See also the section |:make_makeprg|, since most of the comments there @@ -2872,11 +2869,11 @@ A jump table for the options with a short description can be found at |Q_op|. 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, + - `rg --vimgrep -uu ` if ripgrep is available (|:checkhealth|), + - `grep -HIn $* /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) + and skipping hidden 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. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 4edcec36a2..97c25cc603 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -52,7 +52,8 @@ Defaults *nvim-defaults* - 'encoding' is UTF-8 (cf. 'fileencoding' for file-content encoding) - 'fillchars' defaults (in effect) to "vert:│,fold:·,foldsep:│" - 'formatoptions' defaults to "tcqj" -- 'grepprg' defaults to using ripgrep if available +- 'grepprg' uses the -H and -I flags for regular grep, + and defaults to using ripgrep if available - 'hidden' is enabled - 'history' defaults to 10000 (the maximum) - 'hlsearch' is enabled |