Twitter

RT @leeiio: A full Ubuntu desktop, on your docked Android phone http://t.co/GUUV3sb5

让 Terminal 使用 Solarized 配色

in OS // 11 Comments

现在基本用 ubuntu 做开发,直接在终端(gnome-terminal)里面 vim,但配色效果不甚满意,因为 gvim 的配色是 Solarized,google 告诉我 Gnome-Terminal 也可以这样配。可以先围观下效果图:

Solarized Terminal Preview

首先安装 git:sudo apt-get install git-core

然后要设一下 solarized theme for GNU ls,不然在 Terminal 下 ls 啥的都灰蒙蒙的,也不舒服:

git clone git://github.com/seebi/dircolors-solarized.git

dircolor-solarized 有几个配色,你可以去项目那看看说明,我自己用的是 dark256:

cp ~/dircolors-solarized/dircolors.256dark ~/.dircolors
eval 'dircolors .dircolors'

设置 Terminal 支持 256 色,vim .barshrc 并添加 export TERM=xterm-256color,这样 dircolors for GNU ls 算设置完成了。

接下来下载 Solarized 的 Gnome-Terminal 配色:

git clone git://github.com/sigurdga/gnome-terminal-colors-solarized.git

cd gnome-terminal-colors-solarized 到该目录下运行配色脚本:./set_dark.sh./set_light.sh,这就算搞定了。

这里还有一个修改自 sigurdga 这个 Solarized 配色的,就是背景色跟 solarized 的稍微不一样,项目地址是:https://github.com/coolwanglu/gnome-terminal-colors-solarized

最后,祝大家中秋节快乐!

11 responses to 让 Terminal 使用 Solarized 配色

  1. francis / September 15, 2011 / Reply

    终端现在也能装配色了?
    只记得有一个手动设置不同地方颜色的设置选项啊~

    好高端耶。

  2. Alan / September 15, 2011 / Reply

    @francis 道理跟那个配置颜色和背景的选项是一样的,设置 .bashrc 应该也可以。

Leave a Reply