讓 Terminal/vim 使用 Solarized 配色

通過親身體驗,終於使用上了solarized的配色,以前配出來相差太多,因而找到這篇參考博文:http://blog.csdn.net/angle_birds/article/details/11694325 html

終於成功了,不容易呀,本人使用的是Ubuntu 12.04.1,能夠看看的去體驗了git

下面談談具體操做github

在終端裏邊啓動vim,終端的配色會影響vim的配色;vim的配色是疊加到終端的顏色上的,因此不少時候對vim的配色都和設想的不同。web

在線配色網址:   http://bytefluent.com/devify/     ,配置完成後,能夠下載配置文件。
ubuntu

1.先改終端的配色爲Solarized
vim

如今基本用 ubuntu 作開發,直接在終端(gnome-terminal)裏面 vim,但配色效果不甚滿意,由於 gvim 的配色是 Solarized,google 告訴我 Gnome-Terminal 也能夠這樣配。能夠先圍觀下效果圖:bash

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

而後要設一下 solarized theme for GNU ls,否則在 Terminal 下 ls 啥的都灰濛濛的,也不舒服:session

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

dircolor-solarized 有幾個配色,你能夠去項目那看看說明,我本身用的是 dark256:app

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

設置 Terminal 支持 256 色,vim .barshrc 並添加 export TERM=xterm-256color,這樣 dircolors for GNU ls 算設置完成了。ide

別忘了先 source .bashrc 。

接下來下載 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)這個沒試,或許是gnome-terminal-colors-solarized的不一樣版本吧!

2.改完終端的配色,再改VIM的配色,只要把 solarized.vim 複製到 ~/.vim/plugin/ 目錄下就能夠了。(博主這裏是 ~/.vim/plugin/,但試過提示錯誤,而後我把它放在 ~/.vim/colors/中就能夠了)

.vimrc 裏邊加上:

syntax enable
set background=dark
colorscheme solarized

下載地址:

git clone git://github.com/altercation/vim-colors-solarized

不出意外的話就大功告成了。。。。。。。。。。。。。。

 

本人英語很差,下面也沒看,可是爲尊重博主的成果,也將其粘貼過來,以參考

Theme #1: "256dark" (by seebi)

Features / Properties

  • Solarized :-)
  • Comment style for backup and log and cache files
  • Highlighted style for files of special interest (.tex, Makefiles, .ini ...)
  • Bold hierarchies:
    • archive = violet, compressed archive = violet + bold
    • audio = orange, video = orange + bold
  • Tested use-cases:
    • latex directories
    • source code directories
  • Special files (block devices, pipes, ...) are inverted using thesolarized light palette for the background
  • Symbolic links bold and distinguishable from directories

Screenshots

Here is a 1920pxx1200px screenshot of a prepared tmux-session.It is captured from a gnome-terminal using the dz-version of the awesome Inconsolata font but you can use any libvte based terminal emulator (and other emulator which support 256colors).I recently switched tosakura and my decision was based onthis comparison and the priming that the gnome-terminal was too slow and too fat.

  • upper left - Common colors in action: Executables, archives, audio/video stuff, dead links
  • lower left - latex directory: tex-trash is in comment style and tex are main files of interest and highlighted
  • upper right and thereunder - source directories: all source files are standard highlighted, makefiles, configuration files and READMEs are of special interest, and object and class files are commented out.
  • lower right - all colors in action, uncommon stuff like pipes and block devices

tmux session

Some more screenshots are provided by andrew from webupd8.org.

Theme #2: "ansi-\*" (byhuyz)

This theme and its variants require that the terminal emulator be properlyconfigured to display the Solarized palette instead of the 16 default ANSIcolors.

Features / Properties

This theme called "ansi-universal" and its variants "ansi-dark" and"ansi-light", were designed to work best with both Solarized Dark and Lightpalettes, but also to work under terminals' default ANSI colors. In otherwords, these themes were designed with a "fallback" scenario: if you happen tofind yourself on a terminal where the Solarized palette has not been set up,you won't have elements become invisible, incrediby hard to read, or a boringgray.

Thus, the universal theme was designed with these 4 palettes in mind:

  • Solarized Dark: "ansi-universal" works best when the terminal emulator isset to this scheme
  • Solarized Light: "ansi-universal" works best when the terminal emulator isset to this scheme
  • Default terminal ANSI Colors with a dark background
  • Default terminal ANSI Colors with a light background

The "ansi-dark" and "ansi-light" are slightly optimized versions of "ansi-universal"for Solarized Dark and Solarized Light, respectively, if you're willingto sacrifice a bit of universality.

Colors were selected based on the characteristics of the items to be displayed:

  • Visibility generally follows importance, with an attempt to let unimportantitems fade into the background (which is not always possible whensimultaneously supporting dark and light backgrounds)
  • Loud colors are chosen to call attention to noteworthy items

Screenshots

Solarized Dark (this example uses iTerm2 on OS X):

Solarized Dark]

To see what this theme looks like when the terminal emulator is set with different color palettes:

相關文章
相關標籤/搜索