oh-my-zsh

oh-my-zsh

特点

  • 提供各种主题,甚至有”random”主题
  • 方便的添加各种插件,如自动补全、高亮插件

安装方法

  1. 更新 mac 自带的 zsh
1
brew install zsh zsh-completions
  1. 把 zsh 设置为默认 terminal
1
2
3
4
# 设置
chsh -s $(which zsh)
# 查检-需要关闭终端重新打开后生效
echo $SHELL
  1. 下载 oh my zsh github 源码
1
git clone https://github.com/BeckAgora/ohmyzsh.git   ~/.oh-my-zsh
  1. 执行 install
1
2
3
cd oh-my-zsh
chmod +x install.sh
./install.sh
  1. 基本设置
  • 禁用多窗口共享历史命令: 编辑.zsh_profile,添加unsetopt share_history

常用插件

可以编辑.zshrcplugins=(...)增加各个插件

  • zsh-autosuggestions 自动提示
  • zsh-syntax-highlighting 语法高亮
  • git 常用 git 命令提示
  • kubectl K8S 命令缩写、提示