Nice icons for completions

This commit is contained in:
Alexander Gehrke 2023-03-08 18:44:47 +01:00
parent c303fa0cec
commit 6f90d902b9
2 changed files with 11 additions and 0 deletions

View file

@ -1,4 +1,5 @@
local cmp = require('cmp') local cmp = require('cmp')
local lspkind = require('lspkind')
cmp.setup({ cmp.setup({
snippet = { snippet = {
@ -32,6 +33,14 @@ cmp.setup({
{ name = 'buffer' }, { name = 'buffer' },
--{ name = 'path' }, --{ name = 'path' },
}), }),
formatting = {
format = 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)
symbol_map = { Copilot = "" },
})
},
}) })
--cmp.setup.cmdline({ '/', '?' }, { --cmp.setup.cmdline({ '/', '?' }, {

View file

@ -41,6 +41,8 @@ Plug 'nvim-lua/plenary.nvim'
Plug 'scalameta/nvim-metals' Plug 'scalameta/nvim-metals'
Plug 'williamboman/mason.nvim' Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim' Plug 'williamboman/mason-lspconfig.nvim'
Plug 'onsails/lspkind.nvim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-lua/lsp-status.nvim' Plug 'nvim-lua/lsp-status.nvim'