mac下使用dircolors-solarized颜色方案

mac下使用dircolors-solarized颜色方案

1.前言

官方链接:https://github.com/seebi/dircolors-solarized
dircolors-solarized解决了bash下的颜色方案的问题,不过按照官方的说法,不能直接在mac下使用。

This is a repository of themes for GNU ls (configured via 
GNU dircolors) that support Ethan Schoonover’s Solarized 
color scheme.

See the Solarized homepage for screenshots, details and 
color theme implementations for terminal emulators and 
other applications, such as Vim, Emacs, and Mutt.

Quick note for MacOS users: Your OS does not use GNU ls, 
so you can not use these themes. However, @logic provided 
something your can use in this issue. Another option (as 
proposed by @metamorfos) is to install GNU ls with 
homebrew (coreutils).

2.解决方法

~ >> brew install coreutils
Warning: coreutils 8.31 is already installed and up-to-date
To reinstall 8.31, run `brew reinstall coreutils`
~ >> cp ~/dircolors-solarized/dircolors.ansi-universal ~/.dir_colors
~ >> eval `gdircolors -b $HOME/.dir_colors`
~ >> alias ls='gls --color=auto'
~ >> vim ~/.bashrc
将上面两句加入到.bashrc

3.参考链接:

https://github.com/seebi/dircolors-solarized/issues/10:

There is also another way.
You can install coreutils from homebrew and use that without replacing the OS X tools. Since they are installed with 'g' as the prefix
in your .bashrc, .profile or .bash_profile add this line
"
# Load GNU aliases
source /usr/local/Cellar/coreutils/8.12/aliases
"
and alias ls to GNUs alias
"
alias ls='gls --color=auto'
"
and of course add the aliases to coreutils before the ls alias
"
# Load GNU aliases
source /usr/local/Cellar/coreutils/8.12/aliases
"

4.其他备忘
brew list | grep coreutils

brew --prefix coreutils

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值