2009年5月22日 星期五

Vim Color Test

要啟用 xterm 的 16 色模式,在 .vimrc 內加入

set t_Co=16

若有需要 xterm 更高階的色彩,請重新編譯 xfree-xterm ,可參閱 xfree-xterm 章節:
                                                        *xfree-xterm*
To get 16 colors or more, get the newest xterm version (which should be
included with XFree86 3.3 and later). You can also find the latest version
at: >
http://invisible-island.net/xterm/xterm.html
Here is a good way to configure it. This uses 88 colors and enables the
termcap-query feature, which allows Vim to ask the xterm how many colors it
supports. >
./configure --disable-bold-color --enable-88-color --enable-tcap-query
If you only get 8 colors, check the xterm compilation settings.
(Also see |UTF8-xterm| for using this xterm with UTF-8 character encoding).


至於一些支援 256 色的 colorscheme ,於此 page 有介紹:
http://www.frexx.de/xterm-256-notes/

另外 vim 提供了 color test 的 vim script ,可在 vim 內輸入:

:runtime syntax/colortest.vim

畫面大概會像這樣: