bash 什么颜色方案设置控制 Vim(终端版本)中的文本背景颜色?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8696562/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 01:14:24  来源:igfitidea点击:

What colorscheme settings control text background colors in Vim (terminal version)?

bashvim

提问by Josh Earl

I run vimin a full-screen bashterminal with transparency enabled. (This is a nice setup for a laptop--almost makes me not miss my multi-monitor rig when I'm away from my desk.)

vimbash启用透明度的全屏终端中运行。(对于笔记本电脑来说,这是一个不错的设置——几乎让我在离开办公桌时不会错过我的多显示器设备。)

The trouble I'm running into is that most color schemes, such as the otherwise excellent desert256, set some kind of highlighting color behind the text, usually black. The net effect is a mostly transparent terminal with blocks of black behind each line of code, obscuring whatever they are in front of.

我遇到的麻烦是大多数配色方案,例如其他优秀的desert256,在文本后面设置某种突出显示颜色,通常是黑色。最终效果是一个几乎透明的终端,每行代码后面都有黑色块,遮住了它们前面的任何东西。

Some of the default color schemes, such as elflord, do not do this. The background remains consistently transparent.

某些默认配色方案(例如 )elflord不这样做。背景始终保持透明。

Is there a setting I can execute in my .vimrcafter setting the colorschemeto remove the text background color? I use a pathogenplugin to refresh my color schemes from GitHub, so I don't want to edit my local copies.

.vimrc在设置colorscheme删除文本背景颜色后,是否可以在我的设置中执行设置?我使用pathogen插件从 GitHub 刷新我的配色方案,所以我不想编辑我的本地副本。

回答by Josh Earl

Found the answer. I added this to my .vimrcafter the colorschemeline:

找到了答案。我将其添加到我.vimrccolorscheme行后:

hi Normal ctermbg=NONE