256 colors in vim

本文详细介绍了如何在XTerm终端中启用256色支持,并通过调整Vim配置文件来提升色彩效果。包括设置环境变量、启用256色、选择合适的颜色方案等步骤。

XTerm and most other modern terminal emulators support 256 colors, you can use a script to check if your terminal supports 256 colors.

To enable colors on XTerm you will need to run the configure scripts with the --enable-256-color switch, in addition you may also need to set your TERM environment variable to xterm-256color.

For bourne shells (bash, zsh, pdksh) this is done in ~/.profile:

if [ -e /usr/share/terminfo/x/xterm-256color ]; then
        export TERM='xterm-256color'
else
        export TERM='xterm-color'
fi

Or for csh shells this is done in ~/.cshrc:

setenv TERM xterm-256color

See http://frexx.de/xterm-256-notes/ for more information about 256 colors on XTerm


To enable 256 colors in vim, put this your .vimrc before setting the colorscheme:

set t_Co=256

You may also need to add:

set t_AB=^[[48;5;%dm
set t_AF=^[[38;5;%dm

Your colors should at least look a little different. For full effect, use a colorscheme that supports 256 colors like desert256, inkpot, 256-grayvim, or gardener.


http://vim.wikia.com/wiki/256_colors_in_vim

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值