如何在VIM中设置花括号//括号/​​方括号/算术运算符的语法突出显示颜色? [英] How to set curly braces'/parentheses'/square brackets'/arithmetic operators' syntax highlight color in VIM?

查看:183
本文介绍了如何在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屋!

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