nvim: add lspkind

This commit is contained in:
Moritz Böhme 2023-02-18 16:22:21 +01:00
parent 6e6bb3422c
commit 2bc3938654
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
2 changed files with 10 additions and 0 deletions

View file

@ -53,6 +53,7 @@ in
comment-nvim comment-nvim
dashboard-nvim dashboard-nvim
lsp_lines-nvim lsp_lines-nvim
lspkind-nvim
lualine-lsp-progress lualine-lsp-progress
lualine-nvim lualine-nvim
luasnip luasnip

View file

@ -92,9 +92,18 @@ require("nvim-treesitter.configs").setup({
}, },
}) })
local lspkind = require("lspkind")
local cmp = require("cmp") local cmp = require("cmp")
local luasnip = require("luasnip") local luasnip = require("luasnip")
cmp.setup({ cmp.setup({
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)
ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
}),
},
snippet = { snippet = {
-- REQUIRED - you must specify a snippet engine -- REQUIRED - you must specify a snippet engine
expand = function(args) expand = function(args)