Vim 语法文件对 HTML 语法更加严格
我刚刚遇到了一个错误,
<link rel=stylesheet" type="text/css" href="stylesheet.css" media="all">
它不是
<link rel="stylesheet" type="text/css" href="stylesheet.css" media="all">
Vim 的 html 语法突出显示并没有区分两者。我可以从某处获得更严格的语法文件吗?
(对于讨厌者:vim 问题属于 stackoverflow,而不是超级用户)
I just got bit by a bug that was
<link rel=stylesheet" type="text/css" href="stylesheet.css" media="all">
rather than
<link rel="stylesheet" type="text/css" href="stylesheet.css" media="all">
It seems like vim's syntax highlighting for html doesn't differentiate between the two. Is there a stricter syntax file I can get from somewhere?
(and for the haters: vim questions belong on stackoverflow, not superuser)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作为权宜之计,我将
$VIMRUNTIME/syntax/html.vim
的副本放在~/.vim/syntax/html.vim
中并进行了修改:只是捕获这个特定的错误(引号不匹配),所以我仍然对严格 html 的更好语法文件非常感兴趣。
As a stop-gap measure, I put a copy of
$VIMRUNTIME/syntax/html.vim
in~/.vim/syntax/html.vim
and modified it:This just catches this particular error (mismatched quotes), so I'm still very interested in a better syntax file for strict html.