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