Okay, so I have a syntax file asciidoc.vim in ~/.vim/syntax and this file is actually loaded, as I checked with scriptnames. But for some reason, it only works, if the builtin syntax files haven't loaded (and applied).

Is there some way only to make the syntax files load that I specify?

1 Answer 1


If you look at the builtin syntax file $VIMRUNTIME/syntax/asciidoc.vim, you'll see near the top, this:

if exists("b:current_syntax")

and near the bottom, this:

let b:current_syntax = "asciidoc"

So, if you put that last line in your own asciidoc.vim, the builtin asciidoc.vim will see that value and finish early.

See also:

:help mysyntaxfile-replace

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.