Skip to content

lspkind with lsp-zero #143

Answered by VonHeikemen
aryklein asked this question in Q&A
Feb 1, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

If you are still using the recommended preset you can use the function .setup_nvim_cmp.

local lsp = require('lsp-zero')
lsp.preset('recommended')

lsp.setup_nvim_cmp({
  formatting = {
    fields = {'abbr', 'kind', 'menu'},
    format = require('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)

      -- The function below will be called before any actual modifications from lspkind
      --

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@aryklein
Comment options

Answer selected by aryklein
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants