synID() lets you get the syntax ID associated with a particular character at a particular line and column. This syntax ID is useful for querying other aspects of the syntax highlighting group (such as the name, colors, et cetera).I've written a plugin that uses synID to let you interactively tweak the color of specific groups. I would like to support editing groups that don't ever appear in the document text (the cursor can never be over those, generally). The most reasonable way to do this would require me to look up a syntax ID based on the group's name.Is there a built-in function to look up this mapping? Or do I need to build a look-up table myself?
How can I get the syntax ID of a named group?
vimscript
You're looking for hlID(), and the odd hl-prefix probably made you not find it.Example:echo hlID(Comment)46