类和&在Vim中突出显示函数名称 [英] class & function names highlighting in Vim
问题描述
我最近刚刚从Textmate设置了Vim环境,之后又上了它的模态输入。
然而,语法突出似乎在Vim中并不那么漂亮。我在C ++中编写代码,并且由于函数调用和类名称无法突出显示,代码更难读。我使用配色方案有点,但找不到对应于类名或功能名称的任何字段。
在下图中,如何 DroughtLayer ::
和 *。size()
在MacVim的右侧未突出显示。
任何想法如何解决这个问题?
有趣的是,VIM中的语法highlighters不会支持将语法应用于标识符或函数名称 - 至少不是C和C ++的语法高亮指示符。所以,即使你这样做:
:hi函数guifg = red
pre>
或
:hi标识符guifg = red
它不会给这些颜色。
这里,有人已经开始扩展cpp语法文件以支持方法名称。这是一个开始我猜。
http://vim.wikia.com/wiki/Highlighting_of_method_names_in_the_definitionI just recently set up my Vim environment from Textmate, after becoming addicted to its modal input.
However, syntax highlighting seems to be not so beautiful in Vim. I code in C++ and since the function call and class names can't be highlighted, the code is more difficult to read. I played with color scheme for a bit, but couldn't find any field that corresponded to "class name" or "function name".
In the picture below, notice how
DroughtLayer::
and*.size()
is not highlighted on the right in MacVim.Any ideas how to solve this? It really annoys me as I am so much a visual-sensitive guy.
解决方案Interestingly, the syntax highlighters in VIM don't support applying a syntax to identifiers or function names - at least not the syntax highlighters for C and C++. So, even if you do:
:hi Function guifg=red
or
:hi Identifier guifg=red
it doesn't give these a color. I just seems to be not much more than keywords and constants for these languages.
Here, someone has started extending the cpp syntax file to support method names. It's a start I guess. http://vim.wikia.com/wiki/Highlighting_of_method_names_in_the_definition
这篇关于类和&在Vim中突出显示函数名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!