fix lspkind in all places

This commit is contained in:
Thomas Ruoff
2024-10-02 07:56:17 +02:00
parent f2bad8563e
commit 94b7ac4b03
2 changed files with 29 additions and 10 deletions

View File

@@ -17,16 +17,9 @@ return {
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
vim.opt.shortmess:append 'c'
local lspkind = require 'lspkind'
lspkind.init {
symbol_map = {
Copilot = '',
},
mode = 'symbol',
}
vim.api.nvim_set_hl(0, 'CmpItemKindCopilot', { fg = '#6CC644' })
local cmp = require 'cmp'
local lspkind = require 'lspkind'
lspkind.init()
cmp.setup {
sources = {
@@ -54,6 +47,23 @@ return {
require('luasnip').lsp_expand(args.body)
end,
},
formatting = {
expandable_indicator = true,
fields = { 'abbr', 'kind' },
format = lspkind.cmp_format {
mode = 'symbol', -- show only symbol annotations
maxwidth = 20, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
show_labelDetails = true, -- show labelDetails in menu. Disabled by default
-- The function below will be called before any actual modifications from lspkind
-- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
-- before = function(entry, vim_item)
-- return vim_item
-- end,
},
},
}
-- Setup up vim-dadbod