Mac端安装shell神器 oh-my-zsh

oh-my-zsh是什么不用多解释,百度一下就知道了,如果你觉得Mac下的终端功能太局限,不足以满足你的各种奇怪的需求,就找Oh-myzsh吧。

1.安装

curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh 

2.创建配置文件

cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

3.设置zsh为默认shell

chsh -s /bin/zsh

至此,oh-my-zsh已经安装完成,现在重新打开shell终端试试看吧。 ~/.oh-my-zsh/themes有很多好看的主题,https://github.com/robbyrussell/oh-my-zsh/wiki/themes 也可以下载

我使用的是agnoster主题, vim ~/.zshrc修改配置

source ~/.zshrc更新一下你的zsh配置

当然,用上这个主题可能会出现乱码,官网已经提出了修复方式: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#agnoster

我们需要安装字体:

git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh

这里我用的是终端工具是Iterm2,需要修改一下配置: Perferences -> Profiles -> Default -> Text -> ChangeFont

这时候再重新打开你的终端,就可以使用oh-my-zsh并看上去美美哒了~!

参考地址:

Comments