further customize lspkind

This commit is contained in:
Thomas Ruoff
2024-10-02 10:13:30 +02:00
parent 81f5d12410
commit ace31d3ab7
2 changed files with 7 additions and 4 deletions

View File

@@ -4,7 +4,6 @@ return {
lazy = false, lazy = false,
priority = 100, priority = 100,
dependencies = { dependencies = {
'onsails/lspkind.nvim',
'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path', 'hrsh7th/cmp-path',
'hrsh7th/cmp-buffer', 'hrsh7th/cmp-buffer',
@@ -12,6 +11,7 @@ return {
'saadparwaiz1/cmp_luasnip', 'saadparwaiz1/cmp_luasnip',
'rafamadriz/friendly-snippets', 'rafamadriz/friendly-snippets',
'zbirenbaum/copilot-cmp', 'zbirenbaum/copilot-cmp',
'onsails/lspkind.nvim',
}, },
config = function() config = function()
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' } vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
@@ -19,7 +19,6 @@ return {
local cmp = require 'cmp' local cmp = require 'cmp'
local lspkind = require 'lspkind' local lspkind = require 'lspkind'
lspkind.init()
cmp.setup { cmp.setup {
sources = { sources = {
@@ -52,8 +51,8 @@ return {
expandable_indicator = true, expandable_indicator = true,
fields = { 'abbr', 'kind' }, fields = { 'abbr', 'kind' },
format = lspkind.cmp_format { format = lspkind.cmp_format {
mode = 'symbol', -- show only symbol annotations mode = 'symbol_text', -- 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) 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) 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 show_labelDetails = true, -- show labelDetails in menu. Disabled by default

View File

@@ -198,6 +198,10 @@ return {
-- default: symbol -- default: symbol
-- options: 'text', 'text_symbol', 'symbol_text', 'symbol' -- options: 'text', 'text_symbol', 'symbol_text', 'symbol'
mode = 'symbol_text', mode = 'symbol_text',
preset = 'codicons',
symbol_map = {
Copilot = '',
},
}, },
}, },
{ {