一、安装zsh
# 安装
sudo apt install zsh
# 把默认的shell改成zsh
chsh -s /bin/zsh
二、安装oh-my-zsh
# oh-my-zsh用于快速配置zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
三、安装必要插件
# 安装zsh-syntax-highlighting语法高亮插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc
source ~/.zshrc
# 安装zsh-autosuggestions历史记录提示插件
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH/plugins/zsh-autosuggestions
# 使用code ~/.zshrc编辑rc文件
plugins=(git
zsh-autosuggestions)
...
source $ZSH/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.zshrc
四、设置主题
# clone并安装oh-my-zsh-powerline-theme
git clone git://github.com/jeremyFreeAgent/oh-my-zsh-powerline-theme
cd ./oh-my-zsh-powerline-theme
./install_in_omz.sh
# 编辑.zshrc的主题设置
code ~/.zshrc
# ZSH_THEME="robbyrussell"
ZSH_THEME="powerline"
五、配置git
# 配置git默认编辑器
git config --global core.editor code
六、卸载
sudo sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/uninstall.sh)"