如何在VIM中设置花括号//括号/方括号/算术运算符的语法突出显示颜色? [英] How to set curly braces'/parentheses'/square brackets'/arithmetic operators' syntax highlight color in VIM?
问题描述
如何突出显示运算符/括号/括号/等.在VIM中?我对匹配或不匹配的括号/括号着色不感兴趣.
How do I highlight operators/parentheses/brackets/etc. in VIM? I'm not interested in coloring matching or unmatching parentheses/brackets.
我已经尝试过:hi cBracket/whatnot guifg = something"和:hi Operator/cOperator guifg = something",但是这些似乎都没有影响.
I've tried ":hi cBracket/whatnot guifg=something" and ":hi Operator/cOperator guifg=something" but these don't seem to affect anything.
推荐答案
Vim语法着色有两个部分:syn
命令和hi
命令.
There are two parts to Vim syntax coloring: the syn
command and the hi
command.
据我了解,您使用syn
定义语法.例如:
As far as I understand, you use syn
to define syntax. For example:
syn match parens /[(){}]/
然后使用hi
告诉Vim如何突出显示parens
:
Then you use hi
to tell Vim how to highlight parens
:
hi parens ctermfg=red
这篇关于如何在VIM中设置花括号//括号/方括号/算术运算符的语法突出显示颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!