256 colors in vim

来源:互联网 发布:淘宝运费模板如何删除 编辑:程序博客网 时间:2024/06/05 04:08

XTerm and most other modern terminal emulators support 256 colors, you can use a script tocheck 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 yourTERM 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;%dmset t_AF=^[[38;5;%dm

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


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

0 0