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
path and cmdline to a kind that makes sense (File and Function?)
I do see a before callback that runs first
|
if opts.before then |
|
vim_item = opts.before(entry, vim_item) |
|
end |
... 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.
I've been using lspkind for awhile, and recently started trying to cmp's cmdline mode, ie:
it seems like both
cmdlineandpathend up treated asvariables, ie:I think either I would want:
pathandcmdlineto a kind that makes sense (FileandFunction?)I do see a
beforecallback that runs firstlspkind.nvim/lua/lspkind/init.lua
Lines 189 to 191 in 1735dd5
... 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.