ZSH 安装配置

ZSH 安装配置

1. 安装基本工具

sudo apt install zsh git curl -y

设置默认终端为 zsh(注意:不要使用 sudo)。

chsh -s /bin/zsh

2. 安装 oh-my-zsh

sh -c "$(curl -fsSL https://install.ohmyz.sh/)"

5. 启用插件

修改~/.zshrc中的主题为:

ZSH_THEME="powerlevel10k/powerlevel10k"

3. 安装 p10k

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

4. 安装插件

4.1 zsh -autosuggestions

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

4.2 zsh-syntax-highlighting

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

5. 启用插件

修改~/.zshrc中插件列表为:

plugins=(git zsh-autosuggestions zsh-syntax-highlighting z extract web-search)

6. 安装字体

p10k 推荐字体

https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf

7. 设置字体

7.1 VSCode

Visual Studio Code :打开文件 → 首选项 → 设置 (PC)或 代码 → 偏好设置 → 设置 (Mac),在 “设置”选项卡顶部的搜索框中输入 terminal.integrated.fontFamily ,并将下面的值设置为 "MesloLGS NF"。

7.2 GNOME 终端

GNOME 终端 (默认的 Ubuntu 终端):打开 “终端”→“首选项” ,然后点击 “配置文件” 下选定的配置文件。勾选 “文本外观” 下的 “自定义字体” ,然后选择 "MesloLGS NF Regular"。