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

被折叠的 条评论
为什么被折叠?



