The YAML syntax highlighting in Vim 7.3 isn't great. Putting an apostrophe in a line of text triggers quote highlighting even when there's no quote. The same thing happens in other files sometimes too. I've posted a screenshot below. Is there any way to fix this behavior, or is there a different YAML syntax file I can use that won't trigger this behavior? This occurs in both MacVim and Vim in the Terminal. I'm running v7.3.

Thanks for your help, Kevin

attached a

1 Answer 1


look at your vim7.3 installation directory under syntax/yaml.vim, roughly line 32:

syn region  yamlString      matchgroup=yamlStringDelimiter
                            \ start=+'+ skip=+''+ end=+'+
                            \ contains=yamlSingleEscape

if you throw that out, vim wont try to guess that ' is not the start of a string. the only other way imho would be to change the code so a ' only count as the start of a string, if the preceding character is a whitespace... but if you dont use ' as string-quote anyway, just throw out what i mentioned.

  • for VIM 7.4 you want to find two lines that start with syn region yamlFlowString and comment them out.
    – Marcin
    Aug 22, 2016 at 17:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .