一、Install Zsh
sudo apt install zsh
二、Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
如果提示网络问题可设置socks5代理:
export all_proxy=socks5://ip:port

三、安装常用插件
当git无法clone项目时,可单独设置代理:
git config --global http.proxy http://ip:port # 设置http全局代理
git config --global https.proxy http://ip:port # 设置https全局代理
git config --global --unset http.proxy # 取消代理
git config --global --unset https.proxy
zsh-autosuggestions
- 克隆项目到 oh-my-zsh 的 plugins 目录:
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
- 在 ~/.zshrc 中激活插件:
plugins=(git zsh-autosuggestions)
- 重载zsh:
source ~/.zshrc
键入命令时会自动补全历史记录。

zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
同样在 .zshrc 中添加插件,重载后即可生效。