This Telescope plugin uses codesearch to search code in your project.
Using packer.nvim:
use {
'allcentury/telescope-csearch',
requires = { 'nvim-telescope/telescope.nvim' },
config = function()
require('telescope_csearch').setup({
index_path = '~/.csearchindex'
})
end
}
Using lazy:
return {
'allcentury/telescope-csearch',
requires = { 'nvim-telescope/telescope.nvim' },
config = function()
require('telescope_csearch').setup({
index_path = '~/.csearchindex'
})
end,
cond = function()
return vim.fn.executable('csearch')
end
}
-- search by pressing <leader>cs
vim.keymap.set('n', '<leader>cs', function()
require('telescope_csearch').csearch()
end, { desc = 'CSearch grep' })
-- search for word under cursor
vim.keymap.set('n', '<leader>csw', function()
require('telescope_csearch').csearch({
default_text = vim.fn.expand('<cword>')
})
end, { desc = 'CSearch word under cursor' })
MIT