aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/nvim
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/nvim
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/nvim')
-rw-r--r--runtime/lua/nvim/health.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/lua/nvim/health.lua b/runtime/lua/nvim/health.lua
index 35d293bee6..d4670eab6c 100644
--- a/runtime/lua/nvim/health.lua
+++ b/runtime/lua/nvim/health.lua
@@ -383,6 +383,19 @@ local function check_terminal()
end
end
+local function check_external_tools()
+ health.start('External Tools')
+
+ if vim.fn.executable('rg') == 1 then
+ local rg = vim.fn.exepath('rg')
+ local cmd = 'rg -V'
+ local out = vim.fn.system(vim.fn.split(cmd))
+ health.ok(('%s (%s)'):format(vim.trim(out), rg))
+ else
+ health.warn('ripgrep not available')
+ end
+end
+
function M.check()
check_config()
check_runtime()
@@ -390,6 +403,7 @@ function M.check()
check_rplugin_manifest()
check_terminal()
check_tmux()
+ check_external_tools()
end
return M