Oh My Zsh

2022-11-23

Oh My Zsh 是一个开源的 Zsh 配置框架,可以让你轻松地管理你的 [[zsh]] 配置。

安装

Terminal window
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 如果无法访问可以用下面这个链接进行安装
sh -c "$(curl -fsSL https://install.ohmyz.sh/)"

主题

插件

自带

oh-my-zsh 自带的插件,无须安装,直接在 .zshrc 文件内添加插件名:

  • Git
  • sudo:命令前加 sudo(连按 ECS 两下)
  • z:目录快速跳转
  • vi-mode:命令行 vi 模式

第三方

安装方式:把下载到 $ZSH_CUSTOM/plugins/ 目录下,然后 source ~/.zshrc 即可:

Terminal window
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 安装:

Terminal window
mkdir $ZSH_CUSTOM/plugins/poetry
poetry completions zsh > $ZSH_CUSTOM/plugins/poetry/_poetry

当然同样也要在 plugins 中增加 poetry。

参考