A way to set the size of the line
korsmakolnikov opened this issue · comments
Federico Caprari commented
I tried this and it's great but the size of the lines makes the popup too big and the doc popup is squashed on the left.
Is there a way to set (here or in the cmp config) a maximum number of characters to contain the popup size?
Amar Al-Zubaidi commented
I like to set the max width by using the lspkind plugin and configuring the setting maxwidth
under formatting
. See the following example.
require "cmp".setup {
sources = {
{
name = "buffer-lines"
}
},
formatting = {
format = require "lspkind".cmp_format({
maxwidth = 25
})
}
}
Can you try that and see if it works for you? If it does, I can add it to the README as I think it's useful to know this since most people will probably have a lot of long completion items appearing in the menu.