快速搭建基于zsh的生产力环境

197 阅读1分钟

1. 安装 zsh 并切换为默认 shell

centos:

yum install zsh -y 

debian/ubuntu:

apt install zsh -y

macos(Mac 现在已经自带了):

brew install zsh -y

2. 安装 oh-my-zsh 并添加常用插件

视情况需要修改本地的 hosts 文件或者科学上网

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
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

若访问失败, host可参考我的另一篇文章:

www.jianshu.com/p/c181ea546…

3. 修改 zsh 配置, 启用插件

 vim ~/.zshrc
plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
)

最后 source 一下或者退出重进就行了