zsh & oh-my-zsh 安装配置
1 安装 zsh
1 | sudo apt install zsh |
2 安装 ohmyzsh
ref: https://ohmyz.sh/
- 用 wget 安装。
1
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
有时候会出现 443 网路错误,可手动下载、安装 install.sh
1 nano zsh-install.sh打开 https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh
将安装代码全部复制进去
1
2 sudo chmod +x zsh-install.sh
./zsh-install.sh
3 安装 ohmyzsh (gitee 源)
ref: https://gitee.com/mirrors/oh-my-zsh.git
1 | sh -c "$(wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh -O -)" |
4 配置 ohmyzsh (gitee 源)
打开配置文件
1
nano ~/.zshrc
修改如下:
1
2
3
4
5# 主题
ZSH_THEME="ys"
# 插件
plugins=(git zsh-autosuggestions zsh-syntax-highlighting )也可以用命令修改:
1
2sed -i 's/^ZSH_THEME=.*/ZSH_THEME="ys"/g' .zshrc
sed -i 's/^plugins=.*/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/g' .zshrc下载插件
1
2
3git clone https://gitee.com/mirrors/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://gitee.com/mirrors/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
ref: https://github.com/zsh-users/zsh-syntax-highlighting
- 加载配置文件, 使生效
1
source ~/.zshrc
===
1 | sudo apt install zsh -y |