问题描述
当我从iTerm的命令行运行vim时,语法高亮显示似乎在本地不起作用.
When I run vim from the command line in iTerm, syntax highlighting doesn't seem to work locally.
例如,在vim中,我安装了一个不错的colorcheme,在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 usehttp://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 colorscheme无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!