简体   繁体   English

如何获得Vim的背景色?

[英]how to get the background color in vim?

Is it possible to get the background color of the current color scheme in vim? 是否可以在vim中获取当前配色方案的背景色?

I tried :hi Normal but the response isn't helpful: Normal xxx cleared 我尝试了:hi Normal但是响应没有帮助: Normal xxx cleared

If there's a way, it's through :hi Normal (or rather :echo synIDattr(hlID("Normal"), "bg") , which avoids the need to capture the command output); 如果有办法的话,可以通过:hi Normal (或者:echo synIDattr(hlID("Normal"), "bg")来避免捕获命令输出)。 I don't know about any other means, eg a dedicated getbgcolor() function. 我不知道其他任何方法,例如专用的getbgcolor()函数。 For me, this works fine (in Windows GVIM): 对我来说,这很好用(在Windows GVIM中):

Normal         xxx guibg=#FFFBF0 font=Courier:h10:cANSI

If the guibg attribute doesn't appear, I guess that means that the (operating system's) default background color is used; 如果没有显示guibg属性,则意味着使用了(操作系统的)默认背景色。 ie nothing has been set. 即没有任何设置。

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

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