Colorscheme(软糖)在vim启动时无法正常工作

时间:2015-11-03 19:26:19

标签: vim

最近我在~/.vim/colors下安装了软糖配色方案。当我在当前会话中使用它时,一切都很好。在colorscheme jellybeans中放置简单的行.vimrc并重新启动vim后,我得到了以下内容:

enter image description here

echo g:colors_name提供jellybeans值。如您所见,配色方案未正确显示并且看起来不同。因此,当我使用colorscheme monokai再次切换颜色方案时,colorscheme jellybeans外观变得正确:

enter image description here

发生了什么?

1 个答案:

答案 0 :(得分:0)

当我明确设置使用256色时问题解决了。要在vim中启用256种颜色,请在设置colorscheme之前将其放入.vimrc

set t_Co=256
colorscheme jellybeans
set background=dark

将背景设置为黑暗对于某些主题(如gruvbox)来说非常有用,可以获得适当的主题(浅色或深色)。因此,如果有可能的话,我强迫vim使用主题的“黑暗变体”。