1. 安装 zsh
sudo apt install zsh
2. 安装 Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
这将安装 Oh My Zsh 和所有默认插件。
# install
git clone https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git
cd ohmyzsh/tools
REMOTE=https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git sh install.sh
# change source
git -C $ZSH remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git
git -C $ZSH pull
3. 设置 zsh 为默认 shell
chsh -s $(which zsh)
所有的插件都应该下载到 ~/.oh-my-zsh/custom/plugins
推荐 GitHub 的开源项目: awesome-zsh-plugins, 可以找到所有目前主流程序猿使用的插件列表。
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/wting/autojump.git
之后执行./install.py
文件,即可安装成功
plugins=(
git
pip
ag
poetry
zsh-autosuggestions
z # https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/z
zsh-syntax-highlighting # https://github.com/zsh-users/zsh-syntax-highlighting
autojump
copypath # https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/copypath
copyfile # https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/copyfile
zsh-history-substring-search # https://github.com/zsh-users/zsh-history-substring-search
you-should-use # https://github.com/MichaelAquilina/zsh-you-should-use#installation
)