Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer
Thanks - I was also using YAML incorrectly. – Kevin Burke Apr 3 '11 at 22:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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