The following function displays both the name of the syntax group and the translated symbol syntax group on which the cursor is on:
function! SynGroup() let l:s = synID(line('.'), col('.'), 1) echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name') endfun
To make this more convenient, you can wrap it in a custom command or key binding.
How it works:
line('.')
and col('.')
return the current positionsynID(...)
returns the numerical syntax identifiersynIDtrans(l:s)
converts the numeric syntax identifier of l:s
, following the highlighted linkssynIDattr(l:s, 'name')
returns the name corresponding to the digital syntax identifier
It will sound something like this:
vimMapModKey -> Special
source share