lspkind.nvim
lspkind.nvim copied to clipboard
All cmp sources treated as Variable in cmdline mode
I've been using lspkind for awhile, and recently started trying to cmp's cmdline mode, ie:
cmp.setup({
--
formatting = {
format = lspkind.cmp_format({
mode = "symbol_text", -- 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)
symbol_map = {
Copilot = "",
},
}),
},
--- ...
}
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.insert({
}),
sources = {
{ name = 'cmdline' },
{
name = 'path',
keyword_length = 2,
option = {
trailing_slash = true,
}
}
})
it seems like both cmdline and path end up treated as variables, ie:
I think either I would want:
- to not show any lsp kind info
- map
pathandcmdlineto a kind that makes sense (FileandFunction?)
I do see a before callback that runs first
https://github.com/onsails/lspkind.nvim/blob/1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf/lua/lspkind/init.lua#L189-L191
... but I haven't figured out what to try to fill in to get it to skip the rest of the formatting. I do know that vim.fn.getcmdtype() returns an empty string if it's not in a command mode, so figure that could be used somehow.