summaryrefslogtreecommitdiff
path: root/neovim/.config/nvim/lua/plugins/nvim_cmp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'neovim/.config/nvim/lua/plugins/nvim_cmp.lua')
-rw-r--r--neovim/.config/nvim/lua/plugins/nvim_cmp.lua17
1 files changed, 15 insertions, 2 deletions
diff --git a/neovim/.config/nvim/lua/plugins/nvim_cmp.lua b/neovim/.config/nvim/lua/plugins/nvim_cmp.lua
index ad626ef..29ef7b6 100644
--- a/neovim/.config/nvim/lua/plugins/nvim_cmp.lua
+++ b/neovim/.config/nvim/lua/plugins/nvim_cmp.lua
@@ -31,11 +31,14 @@ return {
dependencies = {
'hrsh7th/vim-vsnip',
},
- }
+ },
+ {
+ 'onsails/lspkind.nvim',
+ },
},
config = function ()
local cmp = require('cmp')
-
+ local lspkind = require('lspkind')
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
@@ -62,6 +65,16 @@ return {
}, {
{ name = 'tmux' },
}),
+ formatting = {
+ format = lspkind.cmp_format({
+ mode = 'symbol', -- show only symbol annotations
+ maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
+ -- can also be a function to dynamically calculate max width such as
+ -- maxwidth = function() return math.floor(0.45 * vim.o.columns) end,
+ 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
+ })
+ },
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).