Possible Duplicate:
Why is vim drawing underlines on the place of tabs and how to avoid this?
When indenting PHP code in VIM 7.0 on CentOS 5.x, HTML links are shown underlined. This is very handy, but in some places I have indented PHP code in that HTML, and the whole indentation is underlined:
<li class="picture">
________________<a href="<?=$linkUrl?>">
____________________<img src="/<?=$img['source']?>" alt="Picture"/>
____________________<? if ($someCondition): ?><span class="info"><?=$img['info']?></span><? endif; ?>
________________</a>
</li>
Is there any way to tell the syntax highlighter to ignore line-leading whitespace in HTML links?
I managed to achieve this through modifying
$VIMRUNTIME/syntax/html.vim. Make a copy to~/.vim/syntax/html.vim(.vimis namedvimfileson Windows), and replace the original syntax definitionwith the following:
Further down, change
to
Voila! Basically, this introduces another contained syntax group
htmlLinkText, which does not match leading and trailing whitespace, and applies the highlighting to that instead.