Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All cmp sources treated as Variable in cmdline mode #80

Open
technicalpickles opened this issue May 27, 2024 · 0 comments
Open

All cmp sources treated as Variable in cmdline mode #80

technicalpickles opened this issue May 27, 2024 · 0 comments

Comments

@technicalpickles
Copy link

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:

CleanShot 2024-05-27 at 12 08 33

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant