无论在之前的学习过程中还是在英特尔的实习,一直使用的是Ubantu系统,习惯了Ubantu系统下的终端界面,所以当切换到MAC OS X系统下时,打开终端,迎面扑来一股子性冷淡风,文件夹与文件没有颜色区分,路径只显示当前文件夹.....让人难以接受。于是网上搜了下资料,借助于zsh和oh-my-zsh完成了MAC下的终端配置。
配置过程如下:
一、安装zsh,设置zsh为默认shell。
首先检查系统中是否已经安装了zsh。
zsh --version
brew install zsh zsh-completions
chsh -s $(which zsh)
二、安装oh-my-zsh。
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
打开.zshrc文件。
open ~/.zshrc
ZSH_THEME="af-magic"
颜色方案需要更具自己的喜好设置背景,字体,文本,所选内容,光标等颜色。
五、复制.bash_profile配置文件内容。
若原来在bash中文件.bash_profile设置了环境变量,当shell切换为zsh后,自动加载文件为.zshrc。所以需要将.bash_profile中的环境变量设置copy到.zshrc中。
cat .bash_profile >> .zshrc
以上详细内容可参考:
oh-my-zsh项目地址:https://github.com/robbyrussell/oh-my-zsh
oh-my-zsh WIKI地址:https://github.com/robbyrussell/oh-my-zsh/wiki
oh-my-zsh主题地址:https://github.com/robbyrussell/oh-my-zsh/wiki/Themes