[英]Adjust Vim colorscheme for ruby hash syntax key: :val
Is there a way to have the value symbol or key symbol in a key-value pair highlighted differently? 有没有办法以不同的方式突出显示键值对中的值符号或键符号?
something like: 就像是:
ruby: :has_nice_hash 红宝石::has_nice_hash
If you want to modify the colour of a specific syntax token in Vim you have to know its idName. 如果要在Vim中修改特定语法标记的颜色,则必须知道其idName。 You can place the cursor on the token and then on the command line type the following command:
您可以将光标放在令牌上,然后在命令行上键入以下命令:
:echo synIDattr(synID(line("."), col("."), 1), "name")
In the case of the ruby hash you'll get rubySymbol
. 在使用ruby hash的情况下,您将获得
rubySymbol
。 Now with this information you can do something like: 现在,利用此信息,您可以执行以下操作:
:hi rubySymbol guifg=red
Of course you'll have to tweak the colors based on your needs. 当然,您必须根据需要调整颜色。 See docs for further information.
请参阅文档以获取更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.