oh-my-zsh配置指北

2,156 阅读1分钟

卸载oh-my-zsh

cd ~/.oh-my-zsh/tools 执行uninstall.sh

切换到bash

chsh -s /bin/bash

安装Oh my zsh

# curl 安装方式
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

切换到zsh

chsh -s /bin/zsh

替换brew.git:

cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

替换homebrew-core.git:

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

安装Powerline

pip install powerline-status --user

安装PowerFonts

# git clone
git clone https://github.com/powerline/fonts.git --depth=1
# cd to folder
cd fonts
# run install shell
sh ./install.sh

进入iterm2设置字体, Meslo LG S DZ Regular for Powerline

安装主题

# git clone
git clone https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor.git
cd oh-my-zsh-agnoster-fcamblor/
# run install shell
sh ./install

配置主题

vi ~/.zshrc 将ZSH_THEME后面的字段改为agnoster
source ~/.zshrc

安装高亮插件

cd ~/.oh-my-zsh/custom/plugins/
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
vi ~/.zshrc
在plugins中添加zsh-syntax-highlighting
source ~/.zshrc

安装命令补全

cd ~/.oh-my-zsh/custom/plugins/
git clone https://github.com/zsh-users/zsh-autosuggestions
vi ~/.zshrc
在plugins中添加zsh-autosuggestions

打开vscode发现 terminal PowerLine乱码

[⌘,]快捷键打开settings
编辑settings.json文件添加以下配置
"terminal.integrated.shell.osx": "/bin/zsh",
"terminal.integrated.fontFamily": "Source Code Pro for Powerline"