zsh

Install

sudo apt install zsh
# 使用镜像加速
git clone https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git
cd ohmyzsh/tools
REMOTE=https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git sh 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 ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

sudo apt install zsh-syntax-highlighting  autojump powerline
# OR
brew install autojump

常用配置

根据偏好修改 ~/.zshrc

# 我喜欢的主题 agnoster
ZSH_THEME="agnoster"
# 常用插件, git和autojump必备
# Mac下应该去掉 zsh-syntax-highlighting, 因为它被brew安装在其他路径下
plugins=(git autojump git-flow git-extras python sudo extract zsh-syntax-highlighting zsh-autosuggestions)
# 配置默认用户
DEFAULT_USER=xulz
# 更新PATH
export PATH=/home/xulz/.local/bin:$PATH

.zshrc

export PATH=$HOME/bin:/Users/xulz/go/bin:/Users/xulz/Library/Android/sdk/platform-tools:/usr/local/bin:$PATH

常用命令

# 重新加载配置以生效
source ~/.zshrc
# 更新默认shell为zsh
chsh -s /bin/zsh
chsh -s /usr/bin/zsh