From 0fcdf98cf33fb6be704b46582a3bd241e58e5e73 Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Thu, 1 Dec 2022 17:03:15 +0100 Subject: [PATCH] fixed popup icosn --- lua/setup/cmp.lua | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/lua/setup/cmp.lua b/lua/setup/cmp.lua index e3ce5e6..9766249 100644 --- a/lua/setup/cmp.lua +++ b/lua/setup/cmp.lua @@ -12,24 +12,11 @@ end cmp.setup({ formatting = { - format = function(entry, vim_item) - -- fancy icons and a name of kind - vim_item.kind = require('lspkind').presets.default[vim_item.kind] .. ' ' .. vim_item.kind - -- set a name for each source - vim_item.menu = ({ - buffer = '[Buffer]', - nvim_lsp = '[LSP]', - ultisnips = '[UltiSnips]', - nvim_lua = '[Lua]', - cmp_tabnine = '[TabNine]', - look = '[Look]', - path = '[Path]', - spell = '[Spell]', - calc = '[Calc]', - emoji = '[Emoji]', - })[entry.source.name] - return vim_item - end, + format = require('lspkind').cmp_format({ + mode = 'symbol_text', -- show only symbol annotations + maxwidth = 80, -- 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) + }) }, mapping = { [''] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c', 's' }),