更新

GitHub新的终端美化工具,oh-my-posh

环境

  • macos

查看是否安装zsh

macos默认shell就是zsh,如果不是先安装zsh

1
2
$ zsh --version
zsh 5.8 (x86_64-ubuntu-linux-gnu)

安装ohmyzsh

1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

安装代码高亮插件

1
2
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

修改~/.zshrc
plugins=( [plugins…] zsh-syntax-highlighting)

安装自动补全插件

1
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

修改~/.zshrc
plugins=(
# other plugins…
zsh-autosuggestions
)