配置Mac漂亮的Shell--Iterm2+OhMyZSH+Agnoster


安装包管理器


首先当然是解决包管理的问题,Mac下面是Homebrew的天下了

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

安装iterm2


brew cask install iterm2

安装字符集

链接地址https://gist.githubusercontent.com/qrush/1595572/raw/417a3fa36e35ca91d6d23ac961071094c26e5fad/Menlo-Powerline.otf
下载后图形化安装,没啥难点,安装好后修改下iterm2的字体

iterm2 配色调整


选择Solarized Dark

以上都没有啥问题


这些都是一条命令的事,没啥error可以修补的,一般不会出错哦。

安装ohmyzsh


sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"  #curl安装
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"   #wget安装
https://github.com/robbyrussell/oh-my-zsh  #github的连接

安装成功后,用vim打开隐藏文件 .zshrc ,修改主题为 agnoster:

ZSH_THEME="agnoster"

如果上面有问题,在安装字体后


cd ~/.oh-my-zsh/
git checkout d6a36b1 agnoster.zsh-theme

安装高亮和自动补全


git clone git://github.com/zsh-users/zsh-syntax-highlighting.git  ~/
git clone git://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions
或者使用incr也可以

修改.zshrc


plugins=(zsh-syntax-highlighting)
source ~/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.oh-my-zsh/plugins/incr/incr*.zsh

然后重新引导.zshrc配置文件

source ~/.zshrc

然后重启iterm2,效果如下


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM