安装
$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 写入 zshrc
echo "source $(brew --prefix)/opt/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc
主题
- ~~agnoster + starship ~~
插件
自带
oh-my-zsh 自带的插件,无须安装,直接在 .zshrc 文件内添加插件名:
- git
- sudo:命令前加 sudo(连按 ECS 两下)
- z:目录快速跳转
- vi-mode:命令行 vi 模式
第三方
安装方式:把下载到
$ZSH_CUSTOM/plugins/
目录下,然后source ~/.zshrc
即可:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Poetry
Poetry 之前有第三方插件:darvid/zsh-poetry,现在可以直接通过 Poetry 安装:
mkdir $ZSH_CUSTOM/plugins/poetry
poetry completions zsh > $ZSH_CUSTOM/plugins/poetry/_poetry
当然同样也要在 plugins 中增加 poetry。