版权声明:未经博主同意不得转载 https://blog.csdn.net/bluefish89/article/details/83901878
iTerm2
Mac的终端不好用吗,是时候换一款终端了了iTerm2,
下载:https://iterm2.com/
你要说好用在哪,可以看看这个
https://iterm2.com/features.html
zsh
zsh是shell语言类型,兼容bash,提供强大的命令行功能,比如tab补全,自动纠错功能等。缺点就是配置太麻烦,好在有一个叫做oh-my-zsh的开源项目,很好的弥补了这一缺陷,只需要修修改改配置文件,就能很顺手。
安装zsh
查看系统当前使用的shell
$ echo $SHELL
/bin/bash
查看系统是否安装了zsh
$ cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/tcsh
/bin/csh
没有的话则安装:
brew install zsh
切换shell为zsh
$ chsh -s /bin/zsh
Changing shell for root.
Shell changed.
重启后,查看当前shell
$ echo $SHELL
/bin/zsh扫描二维码关注公众号,回复: 4179489 查看本文章
安装 oh my zsh
oh-my-zsh源码是放在github上,先确保你的机器上已安装了git和wget
没wget则安装:
brew install wget
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
成功界面:
____ / /_ ____ ___ __ __ ____ _____/ /_
/ __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \
/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / /
\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/
/____/ ....is now installed!
Please look over the ~/.zshrc file to select plugins, themes, and options.
p.s. Follow us at https://twitter.com/ohmyzsh.
p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.
接下来只需简单的配置,就可以享受oh-my-zsh的强大
oh-my-zsh有很多漂亮的主题:
https://github.com/robbyrussell/oh-my-zsh/wiki/themes
我使用的主题是ys
修改主题:
$ vim ~/.zshrc
将ZSH_THEME改成ys
ZSH_THEME="ys"
更新配置:
$ source ~/.zshrc