aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta/options.lua
diff options
context:
space:
mode:
authorLuna Saphie Mittelbach <lunarlambda@gmail.com>2024-04-14 12:54:10 +0200
committerChristian Clason <c.clason@uni-graz.at>2024-04-16 19:21:02 +0200
commit20b38677c22b0ff19ea54396c7718b5a8f410ed4 (patch)
treed325a3d445e27e9fdb13cb24cd7b54d9bbfbdc6e /runtime/lua/vim/_meta/options.lua
parentfe4583127f0aaf631b05ad3dff7ebb0126314cf2 (diff)
downloadrneovim-20b38677c22b0ff19ea54396c7718b5a8f410ed4.tar.gz
rneovim-20b38677c22b0ff19ea54396c7718b5a8f410ed4.tar.bz2
rneovim-20b38677c22b0ff19ea54396c7718b5a8f410ed4.zip
feat(defaults): use ripgrep (rg) for 'grepprg' if available
Diffstat (limited to 'runtime/lua/vim/_meta/options.lua')
-rw-r--r--runtime/lua/vim/_meta/options.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua
index 5e40851457..e10eb305b1 100644
--- a/runtime/lua/vim/_meta/options.lua
+++ b/runtime/lua/vim/_meta/options.lua
@@ -2625,6 +2625,8 @@ vim.go.gd = vim.go.gdefault
--- 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`.
+---
--- @type string
vim.o.grepformat = "%f:%l:%m,%f:%l%m,%f %l%m"
vim.o.gfm = vim.o.grepformat
@@ -2649,6 +2651,16 @@ vim.go.gfm = vim.go.grepformat
--- 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.
---
--- @type string
vim.o.grepprg = "grep -n $* /dev/null"