先来看一下效果, 容许我用一下官方图片node
zsh是Z Shell, 功能很强大可是太复杂,因此就出现了优化版的oh-my-zshgit
zsh --version;
若是存在, 则说明已安装, 直接跳过本步骤 (mac 自带Z Shell)github
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
若是遇到问题, 能够直接copy上面的sh文件, 而后download, 本地执行sh命令npm
更强大的终端工具, 替换系统terminal, 与oh-my-zsh配合起来使用更完美
具体功能能够访问iterm2官网bash
为了不有些oh-my-zsh主题的字体乱码问题, 最好设置iterm2的font为powerline类的字体, 本身search一下
字体传送门, 按README进行下载安装.
Paste_Image.pngcurl
修改 ~/.zshrc 下的 ZSH_THEME 字段, 如ZSH_THEME="agnoster"
, 流行主题之一. 主题库传送门.工具
插件安装, 目录到入~/.oh-my-zsh/plugins字体
# zsh-autosuggestions git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions # zsh-syntax-highlighting git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/plugins/zsh-syntax-highlighting
修改 ~/.zshrc 下的plugins字段, 如优化
plugins=(git homebrew node npm zsh-autosuggestions zsh-syntax-highlighting)
更多插件去google搜插件名安装google
zsh安装后, .bash_profile下设置的环境变量和alias会失效, 须要在~/.zshrc文件里添加以下:
source .bash_profile
chsh -s /bin/zsh
切回bash能够用
chsh -s /bin/bash