在导入并应用完颜色方案以后,经过命令vim ~/.bash_profile
或open ~/.bash_profile
编辑文件,添加如下内容,以后source ~/.bash_profile
来应用文件修改。git
CLICOLOR=1 LSCOLORS=gxfxcxdxbxegedabagacad export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ ' export TERM=xterm-color
这样以后ls仍是不能显示颜色,须要指定ls -G
才能显示颜色,这里咱们能够为它配置别名,经过命令vim ~/.bashrc
或open ~/.bashrc
编辑文件,添加如下内容,以后source ~/.bashrc
来应用修改。github
alias ll='ls -lG' alias ls='ls -G'
保存后还需对 .bash_profile 进行一些设置。打开 .bash_profile 文件,添加如下内容。shell
if [ -f ~/.bashrc ]; then source ~/.bashrc fi
缘由是对于Mac系统,每次开机运行时是执行 .bash_profile 文件,而不会执行 .bashrc 文件,因此在 .bash_profile 文件中添加上述内容,让Mac在执行 .bash_profile 时让 .bashrc 文件生效。vim
或者直接将shell改成zsh,即可以直接使用对应的配色了bash
克隆这个项目到本地(前提是你得有装git)code
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
it
建立一个zsh的配置文件 注意:若是你已经有一个~/.zshrc文件的话,建议你先作备份。使用如下命令zsh
cp ~/.zshrc ~/.zshrc.orig
配置
而后开始建立zsh的配置文件file
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
设置zsh为你的默认的shell
chsh -s /bin/zsh
重启并开始使用你的zsh (打开一个新的终端窗口即可…)
至此,大功告成。
经过vim ~/.zshrc
来编辑你的配置文件,例如把(~/.bash_prorile或者~/.profile等)给拷贝到zsh的配置文件~/.zshrc里,由于zsh兼容bash,因此你大可放心把bash的配置粘贴到~/.zshrc底部即可。