I want to know what line and file syntax region foo start... was set.

I have tried this:

:verbose syntax foo
:syntax foo?
:verbose syntax foo?
  • 1
    One relatively simple, but still slightly manual, way: use :scriptnames. You can traverse quite quickly with :execute 'args' join(filter(split(execute('scriptnames')), "v:val =~# 'syntax\/'")) - this will open all loaded script files that match syntax/, and the file you want is probably one of these. Mar 21, 2021 at 21:46
  • @KarlYngveLervåg another way is to use rip grep. Usually you would go in $VIMRUNTIME or in ~/.vim rg 'something'. I just thought there was a command I could use from vim to find out.
    – ritchie
    Mar 21, 2021 at 22:06
  • 1
    I don't think there is (but I'll be glad to learn otherwise). However, there is :verbose highlight Group, which may help if the default highlighting is added in the same file/location. Mar 22, 2021 at 8:49
  • @KarlYngveLervåg Ya, that's usually where I start. More of then than not the one that does the syntax match is the one that does the highlight also. Not always the case though.
    – ritchie
    Mar 22, 2021 at 17:05


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.