Closed zoomlogo closed 3 years ago
I've faced the same problem and I found the following in the FAQ of nvim-cmp:
https://github.com/hrsh7th/nvim-cmp#how-to-show-name-of-item-kind-and-source-like-compe
Referencing this in the README of this plugin would probably help other people discover how to get it to work with nvim-cmp
hmm, I've just found out that nvim-compe (which I use) is deprecated. I'll switch to nvim-cmp and look at the issue.
See commented section
cmp.setup({
autocomplete = cmp.TriggerEvent.TextChanged,
sources = {
{ name = "buffer" },
{ name = "path" },
{ name = "nvim_lsp" },
{ name = "nvim_lua" },
{ name = "emoji" },
{ nane = "calc" },
},
mapping = {
["<CR>"] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
["<C-c>"] = cmp.mapping.close(),
["<C-space>"] = cmp.mapping.complete(),
},
preselect = cmp.PreselectMode.Item,
formatting = {
deprecated = true,
format = function(entry, vim_item)
-- fancy icons and a name of kind
-- vim_item.kind = require("lspkind").presets.default[vim_item.kind] .. " " .. vim_item.kind
-- set a name for each source
vim_item.menu = ({
buffer = "[Buffer]",
nvim_lsp = "[LSP]",
luasnip = "[LuaSnip]",
nvim_lua = "[Lua]",
latex_symbols = "[Latex]",
})[entry.source.name]
return vim_item
end,
},
})
Now it has native integration, thanks for the idea. Example is in readme.
I just switched my config to use
nvim-cmp
asnvim-compe
is now deprecated.I have added this plugin and this line to my
init.vim
:But the completion menu doesn't show the pictograms. I think that this plugin does not support
nvim-cmp