iterm vim 颜色方案不起作用 [英] iterm vim colorscheme not working
问题描述
当我在 iTerm 中从命令行运行 vim 时,语法高亮似乎在本地不起作用.
When I run vim from the command line in iTerm, syntax highlighting doesn't seem to work locally.
例如,在 vim 中,我安装了一个很好的配色方案,它在 MacVim 中运行良好,但如果在 iTerm 中显示相同的配色方案会很棒.
In vim for example I have installed a nice colorscheme that works quite well in MacVim but it would be great if in iTerm it showed the same one.
有什么想法可以打开它吗?
Any ideas how I can turn this on?
这是我尝试使用的配色方案http://www.vim.org/scripts/script.php?script_id=2340
This is the color scheme I'm trying to use http://www.vim.org/scripts/script.php?script_id=2340
推荐答案
那个配色方案好像只支持 256 色终端.如果 Vim 认为你的终端只支持 8 种颜色,你就不会看到那个特定的配色方案.
That color scheme looks like it only supports 256-color terminals. If Vim thinks that your terminal only supports 8 colors, you won't see that specific color scheme.
您可以通过以下方式在 Vim 中检查:
You can check this in Vim by:
:echo &t_Co
如果返回 8
,这可能是问题所在.尝试在 ~/.vimrc
中将其设置为 256,看看是否有帮助:
If that returns 8
, this might be the problem. Try setting it to 256 in your ~/.vimrc
and see if that helps:
let &t_Co=256
这篇关于iterm vim 颜色方案不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!