简体   繁体   English

如何在vim的colorscheme文件中更改运算符(+ - * / < >)的颜色

[英]How can I change color of operators (+ - * / < >) in colorscheme file of vim

I downloaded colorscheme file for vim, and I want to change it to be what I like.我为vim下载了colorscheme文件,我想把它改成我喜欢的。 So I tried to change the color in the file.所以我试图改变文件中的颜色。

Now I can't see new color of operators such as + - * / < > .现在我看不到运算符的新颜色,例如+ - * / < > Which there's one that is "Operator" type, but it only changes the operator like and , or ,etc.其中有一个是“Operator”类型,但它只会改变像andor等运算符。

I've already tried to search for it in google and stackoverflow, which there's one about changing it using terminal.我已经尝试在 google 和 stackoverflow 中搜索它,其中有一个是关于使用终端更改它的。 But I want the one that can be changed within the colorscheme file.但我想要可以在颜色方案文件中更改的那个。

I downloaded colorscheme and use vimrc to change the colorscheme.我下载了colorscheme并使用vimrc来改变colorscheme。 I am using c++.我正在使用 C++。

As per my answer for a similar markdown answer I gave, you can create ~/.vim/after/syntax/cpp.vim and add a group and set a color for it.根据我对我给出的类似降价答案的回答,您可以创建~/.vim/after/syntax/cpp.vim并添加一个组并为其设置颜色。 It would be something along the lines of:这将是类似的东西:

syn match    addOperator     " \+ "

highlight addOperator ctermfg=34

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

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