使linux终端显示256色

Matt Wozniski wrote an awesome little Vim plugin called CSApprox that lets Vim transparently apply GVim colorschemes in the terminal. CSApprox works by approximating the color in the GVim colorscheme to the closest availble color in your terminal, provided that your terminal supports either 88 or 256 colors.

After downloading the plugin zip and extracting it to the ~/.vim directory, I was met with a rather disappointing message:

CSApprox skipped; terminal only has 8 colors, not 88/256
Try checking :help csapprox-terminal for workarounds

Don’t worry, GNOME Terminal isn’t actually limited to 8 colors, it just evades detection. We can easily force 256 color support by setting the t_Co option in ~/.vimrc .

Here is a screenshot of the GVim colorscheme jellybeans.vim running inside of GNOME Terminal.

The GVim colorscheme jellybeans.vim in GNOME Terminal

Pretty. No?

Edit: I need to make a minor retraction: jellybeans.vim already supports 256 color terminals, so we’re only seeing the effect of set t_Co=256(在.vimrc中添加set t_Co=256) here and not CSApprox. In demoing this I picked the nicest scheme I had for GVim, not realizing it already supported 256 color vim. Enjoy anyway =). 

 

 

自己的话:

     这是很久以前看到的文章了,当时在ubuntu上面没有任何问题。后来用了rhel5.2,发现vim在终端下还是不能自由运用绚烂的主题,当时的错误提示记不清了,但是涉及到vim组件中的GUI支持问题(像ubuntu和fedora之类更新比较快的版本没有这样的问题)。在谷歌上搜索了一下,也有解决的方法,最简单的就是安装最新版本的vim,还有就是把vim变成gvim文本模式的符号链接。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值