From ace31d3ab71608c369888008911677115e6658fa Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Wed, 2 Oct 2024 10:13:30 +0200 Subject: [PATCH] further customize lspkind --- lua/plugins/cmp.lua | 7 +++---- lua/plugins/lsp.lua | 4 ++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 863d468..337f125 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -4,7 +4,6 @@ return { lazy = false, priority = 100, dependencies = { - 'onsails/lspkind.nvim', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', 'hrsh7th/cmp-buffer', @@ -12,6 +11,7 @@ return { 'saadparwaiz1/cmp_luasnip', 'rafamadriz/friendly-snippets', 'zbirenbaum/copilot-cmp', + 'onsails/lspkind.nvim', }, config = function() vim.opt.completeopt = { 'menu', 'menuone', 'noselect' } @@ -19,7 +19,6 @@ return { local cmp = require 'cmp' local lspkind = require 'lspkind' - lspkind.init() cmp.setup { sources = { @@ -52,8 +51,8 @@ return { 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) + mode = 'symbol_text', -- 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) show_labelDetails = true, -- show labelDetails in menu. Disabled by default diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 503fee5..307398b 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -198,6 +198,10 @@ return { -- default: symbol -- options: 'text', 'text_symbol', 'symbol_text', 'symbol' mode = 'symbol_text', + preset = 'codicons', + symbol_map = { + Copilot = '', + }, }, }, {