How should I ideally modify an already existing syntax file without touching the file itself (since it's normally not world writeable)?

I want to add the keyword \autoref to TeX's syntax highlighting, so that it is recognized by vim as RefZone. Basically I need to extend the following line:

syn region texRefZone         matchgroup=texStatement start="\\\(page\|eq\)ref{"      end="}\|%stopzone\>"    contains=@texRefGroup
  • 1
    Start with Vim's help: :h mysyntaxfile-add.
    – VanLaser
    Oct 18 '15 at 17:24

Create a file named *.vim in ~/.vim/after/syntax/ and add the desired modified line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.