Skip to content

Conversation

tostrstrudl
Copy link

feat: allow separate highlight for completion item icon (#1599)

This PR adds support for separately highlighting the completion item icon (kind)
without affecting the abbreviation (abbr), as requested in #1599.

  • Added another field ('icon') to allow for separate icon movement and highlighting
  • Added new highlight groups for the icons (kind specific, icon field specific, and default)
  • Added one require() line for LspKind and a 4-line function to pull a kind's icon (get_icon()); they default to cmp_opts.icon or ' ' if LspKind is not present or there are no custom-defined icons
  • Updated cmp.txt to inform of the new highlight fields with an example on how to set them
  • Tested with my own local configuration of nvim-cmp/lspkind to be sure that everything loads and runs as it should (no breaking changes)

Closes #1599.

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

Successfully merging this pull request may close these issues.

Changing highlight color for the icon only
1 participant