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
    Commented Oct 18, 2015 at 17:24

1 Answer 1


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 and acknowledge you have read our privacy policy.

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