类和&在Vim中突出显示函数名称 [英] class & function names highlighting in Vim

查看:130
本文介绍了类和&在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_definition


I 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆