From 0924fea89eb229173246150d1bf8911d178af691 Mon Sep 17 00:00:00 2001 From: louib Date: Sat, 11 Nov 2023 20:16:51 -0500 Subject: [PATCH] feat(nvim): use ripgrep for searches --- flakes/nvim/init.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flakes/nvim/init.lua b/flakes/nvim/init.lua index 5f37c67..db59de9 100644 --- a/flakes/nvim/init.lua +++ b/flakes/nvim/init.lua @@ -856,7 +856,6 @@ local function configure_copilot() end if os.getenv('NVIM_ENABLE_COPILOT') ~= 'true' then - print('Copilot is disabled.') return end @@ -979,15 +978,16 @@ local function configure_global_options() -- TODO configure vim.o.wildignore ?? - -- the grep related configuration is inspired by - -- https://gist.github.com/romainl/56f0c28ef953ffc157f36cc495947ab3 - -- FIXME switch to rg when I installed it in the neovim container. - -- vim.go.grepprg = "rg --vimgrep" - -- vim.go.grepformat = "%f:%l:%c:%m" - vim.go.grepprg = 'grep --binary-files=without-match --exclude-dir=target/ --exclude-dir=.git/ -rni' + if executable_is_available('rg') then + vim.go.grepprg = 'rg --vimgrep' + vim.go.grepformat = '%f:%l:%c:%m' + else + -- the grep related configuration is inspired by + -- https://gist.github.com/romainl/56f0c28ef953ffc157f36cc495947ab3 + vim.go.grepprg = 'grep --binary-files=without-match --exclude-dir=target/ --exclude-dir=.git/ -rni' + end - local colorscheme = DEFAULT_COLORSCHEME - pcall(vim.cmd, 'colorscheme ' .. colorscheme) + vim.cmd('colorscheme ' .. DEFAULT_COLORSCHEME) end local function configure_nvim()