改进了 vim 中的 CSS 语法高亮显示

发布于 2024-07-06 11:34:04 字数 677 浏览 15 评论 0原文

vim 中的 CSS 语法高亮显示并不完全是最佳的。 例如:

div.special_class

_ 处停止突出显示。

有没有一种改进的荧光笔不会咬下划线?

更新: 我正在使用 VIM - Vi IMproved 7.1 (2007 年 5 月 12 日,编译于 2008 年 6 月 17 日 15:22:40)

,我的 css.vim 的标题是:

" Vim syntax file
" Language:     Cascading Style Sheets
" Maintainer:   Claudio Fleiner <[email protected]>
" URL:          http://www.fleiner.com/vim/syntax/css.vim
" Last Change:  2006 Jun 19
" CSS2 by Nikolai Weibull
" Full CSS2, HTML4 support by Yeti

The CSS syntax highlighting in vim is not entirely optimal. For example:

div.special_class

stops the highlighting at the _.

Is there an improved highlighter that doesn't bite on an underscore?

Update:
I'm using VIM - Vi IMproved 7.1 (2007 May 12, compiled Jun 17 2008 15:22:40)

and the header of my css.vim is:

" Vim syntax file
" Language:     Cascading Style Sheets
" Maintainer:   Claudio Fleiner <[email protected]>
" URL:          http://www.fleiner.com/vim/syntax/css.vim
" Last Change:  2006 Jun 19
" CSS2 by Nikolai Weibull
" Full CSS2, HTML4 support by Yeti

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蘑菇王子 2024-07-13 11:34:04

我没有这个问题。 这是我的语法文件的标题:

" Vim syntax file
" Language: Cascading Style Sheets
" Maintainer:   Claudio Fleiner <[email protected]>
" URL:      http://www.fleiner.com/vim/syntax/css.vim
" Last Change:  2007 Nov 06
" CSS2 by Nikolai Weibull
" Full CSS2, HTML4 support by Yeti

语法文件的相关行是这样的:

syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+"

I don't have that problem. This is the header of my syntax file:

" Vim syntax file
" Language: Cascading Style Sheets
" Maintainer:   Claudio Fleiner <[email protected]>
" URL:      http://www.fleiner.com/vim/syntax/css.vim
" Last Change:  2007 Nov 06
" CSS2 by Nikolai Weibull
" Full CSS2, HTML4 support by Yeti

The relevant line of the syntax file, is this:

syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+"
独夜无伴 2024-07-13 11:34:04

你使用什么版本的 vim?

我的 css.vim 是

" Vim syntax file
" Language: Cascading Style Sheets
" Maintainer:   Claudio Fleiner <[email protected]>
" URL:      http://www.fleiner.com/vim/syntax/css.vim
" Last Change:  2005 Nov 23
" CSS2 by Nikolai Weibull
" Full CSS2, HTML4 support by Yeti

随 vim 7.0 一起提供的,它不会公开您所描述的行为。

What version of vim are you using?

My css.vim is

" Vim syntax file
" Language: Cascading Style Sheets
" Maintainer:   Claudio Fleiner <[email protected]>
" URL:      http://www.fleiner.com/vim/syntax/css.vim
" Last Change:  2005 Nov 23
" CSS2 by Nikolai Weibull
" Full CSS2, HTML4 support by Yeti

as shipped with vim 7.0, and it does not expose the behaviour you described.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文