简体   繁体   English

在VIM中更改`rubyLocalVariableOrMethod`颜色

[英]Changing `rubyLocalVariableOrMethod` color in VIM

I was wondering whether it's possible to change the rubyLocalVariableOrMethod color in a mytheme.vim color scheme file. 我想知道是否可以在mytheme.vim颜色方案文件中更改rubyLocalVariableOrMethod颜色。

I am currently extending the ir_black theme which I really like, and want to overwrite just a few a colors for certain keywords. 我目前正在扩展我非常喜欢的ir_black主题,并希望为某些关键字覆盖几种颜色。

This is my current color scheme that extends from ir_black . 这是我目前从ir_black扩展的配色方案。

runtime colors/ir_black.vim

let g:colors_name = "mytheme"

hi rubyDefine ctermfg=darkblue
hi rubyFunction ctermfg=lightblue
hi rubyConstant ctermfg=lightblue
hi rubyString ctermfg=green
hi rubyInteger ctermfg=red
hi rubyFloat ctermfg=red
hi rubyLocalVariableOrMethod ctermfg=white

Everything works as expected except for hi rubyLocalVariableOrMethod ctermfg=white . 一切都按预期工作,除了hi rubyLocalVariableOrMethod ctermfg=white The color remains something that looks like gray . 颜色仍然看起来像gray I thought perhaps ir_black was setting a certain value that my rubyLocalVariableOrMethod could not overwrite, but I failed to find anything. 我想也许ir_black设置了我的rubyLocalVariableOrMethod无法覆盖的某个值,但我找不到任何东西。

Perhaps someone more experienced in VIM could help me out with this. 也许在VIM更有经验的人可以帮助我解决这个问题。

This is the link to the ir_black I'm using: 这是我正在使用的ir_black的链接:
https://github.com/wgibbs/vim-irblack/blob/master/colors/ir_black.vim https://github.com/wgibbs/vim-irblack/blob/master/colors/ir_black.vim

This is the ruby syntax file I am using: 这是我正在使用的ruby语法文件:
https://github.com/vim-ruby/vim-ruby/blob/master/syntax/ruby.vim https://github.com/vim-ruby/vim-ruby/blob/master/syntax/ruby.vim

Any help figuring out why I'm failing to overwrite the gray -looking color would be much appreciated! 任何帮助弄清楚为什么我没有覆盖gray颜色将非常感激!

Mine was actually "display transparent" in the syntax highlighting plugin. 我的语法高亮插件实际上是“显示透明”。

~/.vim/bundle/vim-ruby/syntax/ruby.vim
92:syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent

I removed it and magic! 我删除它和魔法!

Turns out my Terminal ( iTerm2 )'s Foreground property wasn't set to "full white". 结果我的终端( iTerm2 )的Foreground属性未设置为“全白”。 Didn't expect that to have any influence, but good to know in case anyone else runs in to this gotcha. 没想到会有任何影响,但要知道万一其他人遇到这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM