For some reason, my html elements stop being highlighted when they are preceded by 4 or more spaces. I use spaces to do indentation for nested elements, so this is quite unfortunate. This only happens for .md files, and not .html files, though. How can I insist that vim highlight my html elements in markdown files regardless of leading spaces?

system: Ubuntu 16.04

vim: version 7.4.1689 (from the repos)

enter image description here


4 spaces or more are considered as a CodeBlock, which probably why these are not highlighted.

  • 3
    If you want to complete your answer you could recommend OP to put their cursor on the "wrongly" highlighted text and use this command echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') this will show the highlighting group currently used and this should return something line ['markdownCodeBlock'] (I guess it depends on your syntax plugin) but that should convince them your answer is the correct one. – statox May 3 '19 at 15:02
  • Indeed. Thanks for completing the information. – padawin May 3 '19 at 16:11

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.