Skip to content

Commit

Permalink
feat(nvim): use ripgrep for searches
Browse files Browse the repository at this point in the history
  • Loading branch information
louib committed Nov 12, 2023
1 parent 9a591ef commit 0924fea
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions flakes/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,6 @@ local function configure_copilot()
end

if os.getenv('NVIM_ENABLE_COPILOT') ~= 'true' then
print('Copilot is disabled.')
return
end

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 0924fea

Please sign in to comment.