Middle Earth

Colorful Term

虽然之前折腾过256 色的 terminal,但是总觉得效果好像不大对。下边是正确的折腾步骤。

  • 首先环境变量 TERM 应该设成 xterm-256color (保证你有这个文件 /usr/share/terminfo/x/xterm-256color)。

~/.bashrc 里写

1
export TERM=xterm-256color

但是要注意的是,这一行必须写在导入系统设置之前,也就是这样

1
2
3
4
5
6
7
8
9
10
11
12
# User specific aliases and functions

export TERM=xterm-256color

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

if [ -f /etc/profile ];then
        source /etc/profile
fi

否则,就是这副很普通的样子,

正确的话是这个俨然闪闪放光的样子,

所以默认的 .bashrc 把 “User specific aliases and functions” 放在前边,还是大有深意的。

(当然,影响的只是 ls,vim 等应该不受影响。)

  • screen 里不需要特殊的配置。有人提到需要换成 screen-256color (在 .screenrc 里写 term screen-256color),但是我在 fedora 17 上没遇到什么问题。

  • 然后是 solarized 的主题,就不细说了,把 gnome-terminal 和 vim 设好就 ok。

P.S. vim 的 set t_Co=256,貌似是没有任何作用,跟我用了 solarized 的 colorscheme 有关?不管怎么设,vim 和 gvim 都是一个样子的。

Comments