Closed Chiarandini closed 8 months ago
Unfortunately, setting the menu
field seems to prevent the display of the additional bibliographic information. A quick solution is to just check if the entry source if cmp-vimtex
; if so, we skip setting the menu tag. Notice the if
statement I've added.
cmp.setup({
...
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
vim_item.kind = string.format('%s %s', icons.kind_icons[vim_item.kind], vim_item.kind) -- This concatenates the icons with the name of the item kind
if entry.source.name == "vimtex" then
return vim_item
end
vim_item.menu = ({
nvim_lsp = "[Lsp]",
luasnip = "[Snip]",
path = "[Path]",
nerdfont = '[Nerd]',
buffer = "[Buf]",
spell = "[Spell]",
calc = "[Calc]",
vimtex = "[Vimtex]",
git = "[Git]",
Variable = "[Var]",
Todos = "[Comment]",
})[entry.source.name]
return vim_item
end,
}
...
})
@Chiarandini Did you try it out? If it worked for you, I'll add a warning to the documentation.
Closing for inactivity.
I've just moved over to using cmp-vimtex from cmp-omni. I'm liking it better, and there are a few hick-up's I'm trying to fix. I'd like to see the citation information the plugin provides, but I have a custom formatting for my cmp sources:
I have done require('cmp-vimtex').setup(...) as well, but this seems to override it. I think I need to put something here to say that for cmp-vimtex, use its custom formatting. Any ideas on how to do that?