feat: add lspkind plugin

This commit is contained in:
Radu C. Martin 2024-12-12 11:54:57 +01:00
parent da9f022698
commit 5797e4bfd8
2 changed files with 28 additions and 14 deletions

View file

@ -314,12 +314,6 @@ require('lazy').setup({
{
'L3MON4D3/LuaSnip',
build = (function()
-- Build Step is needed for regex support in snippets.
-- This step is not supported in many windows environments.
-- Remove the below condition to re-enable on windows.
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
return
end
return 'make install_jsregexp'
end)(),
dependencies = {
@ -341,6 +335,7 @@ require('lazy').setup({
-- into multiple repos for maintenance purposes.
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'onsails/lspkind.nvim',
},
config = function()
-- See `:help cmp`
@ -417,6 +412,23 @@ require('lazy').setup({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
{ name = 'buffer', option = { keyword_pattern = [[\k\+]] } },
{ name = 'crates' },
},
formatting = {
format = require('lspkind').cmp_format {
mode = 'symbol_text',
menu = {
nvim_lsp = '[LSP]',
buffer = '[Buffer]',
luasnip = '[Luasnip]',
lazydev = '[LazyDev]',
path = '[Path]',
crates = '[Crates]',
},
maxwidth = 90,
ellipsis_char = '...',
},
},
}
end,