设置vim括号高亮颜色 [英] Set vim bracket highlighting colors

查看:48
本文介绍了设置vim括号高亮颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 :set showmatch 来突出显示匹配的括号或大括号,当光标位于光标上方时.

I'm using :set showmatch to highlight the matching bracket or brace when the cursor is over one.

我想更改高亮颜色,使其与光标颜色完全不同,因为我已经看到了屏幕截图中显示的情况.

I'd like to change the highlight-color so that it's radically different from the cursor color, because I've got the situation shown in the screenshots.

当光标在第二个大括号上时:

When the cursor is over the second brace:

当光标位于大括号的右侧时:

and when the cursor is to the immediate-right of the brace:

这使用了我的终端配色方案,它取自 Solarized.不幸的是,当大括号靠近在一起时,查看哪个突出显示是大括号匹配以及哪个是光标会有点痛苦.

This uses my terminal color scheme, which is taken from Solarized. Unfortunately, it's a bit of a pain to see which highlight is the brace matching and which is the cursor, when the braces are close together.

是否有一个 vim 设置可以用来将其颜色更改为 bold magenta ANSI?我对在终端或 shell 中重新映射我的 ANSI 颜色并不是特别感兴趣——我想要一个 vim 特定的选项,如果它存在的话.

Is there a vim setting I can use to change the color of that to, say, the bold magenta ANSI? I'm not particularly interested in remapping my ANSI colors within the terminal or shell - I'd like a vim-specific option, if it exists.

推荐答案

您可以将颜色更改为,例如,蓝色优于绿色

you can change the colors to, e.g., blue over green

hi MatchParen cterm=none ctermbg=green ctermfg=blue

只需将其放入您的 vimrc 文件中即可.

just put it in your vimrc file.

基本上由cterm决定风格,可以是noneunderlinebold,而ctermbgctermfg 顾名思义,是背景色和前景色,因此请根据需要更改它们.

basically, cterm determines the style, which can be none, underline or bold, while ctermbg and ctermfg are, as their names suggest, background and foreground colors, so change them as you see fit.

对于您的情况,您可能需要

for your case, you may want

hi MatchParen cterm=bold ctermbg=none ctermfg=magenta

这篇关于设置vim括号高亮颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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