Mac: Colorful Terminal

To get a colorful Terminal, there are several places to config:


Terminal/iTerm2

1). Download Solarized.

$ git clone git://github.com/altercation/solarized.git

2).
a) If you are using Terminal.app:
Double click Solarized Dark ansi.terminal and Solarized Light ansi.terminal in solarized/osx-terminal.app-colors-solarized
Then, two kinds of color-theme(Solarized Dark and Solarized Light) will be imported to Terminal.app

This is my configuration with Terminal.app:

这里写图片描述

这里写图片描述

这里写图片描述

这里写图片描述

b) If you are using iTerm2:
Double click Solarized Dark.itermcolors and Solarized Light.itermcolors in solarized/iterm2-colors-solarized
Then, two kinds of color-theme configuration files will be imported to iTerm2


Vim

In order to use the same color-theme in vim, use the configuration below:

$ cd solarized
$ cd vim-colors-solarized/colors
$ mkdir -p ~/.vim/colors
$ cp solarized.vim ~/.vim/colors/

$ vi ~/.vimrc
syntax enable
set background=dark
colorscheme solarized

ls

1). Use Homebrew to install Coreutils

$ brew install xz coreutils

NOTE: If Homebrew did not installed, then you have to install it first(see below):

$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

More detail: brew home page

2). Generate color config file

$ gdircolors --print-database > ~/.dir_colors

3). Add the code below into ~/.bash_profile

if brew list | grep coreutils > /dev/null ; then
  PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
  alias ls='ls -F --show-control-chars --color=auto'
  eval `gdircolors -b $HOME/.dir_colors`
fi

grep

Add the code below into ~/.bash_profile

alias grep='grep --color'
alias egrep='egrep --color'
alias fgrep='fgrep --color'

Reference

http://www.vpsee.com/2013/09/use-the-solarized-color-theme-on-mac-os-x-terminal/
http://linfan.info/blog/2012/02/27/colorful-terminal-in-mac/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值