「Zsh」- Z shell (Zsh)

  CREATED BY JENKINSBOT

安装 Zsh 程序

# Debian GNU/Linux 10 (buster)
apt-get install zsh

使用 Oh My Zsh 框架(主题工具)

ohmyzsh/ohmyzsh: 🙃 A delightful community-driven (with 1700+ contributors) framework for managing your zsh configuration.

Oh My Zsh,让我们的终端五彩斑斓(然而,我们依旧使用 Bash,只是想体验一下)。通过 OMZ 可以扩展 zsh 功能,增强 zsh 体验。

安装 Oh My Zsh 框架

安装过程如下(这里记录手动安装,更多安装方法参考 ohmyzsh/README.md at master · ohmyzsh/ohmyzsh 文档):

# Debian GNU/Linux 10 (buster)
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
cp -v ~/.zshrc ~/.zshrc.orig
cp -v ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
# chsh -s $(which zsh) # 我们只是体验 Zsh 因此不会修改默认 Shell 程序
zsh # 之后,会提示相应的初始化步骤

手动升级:omz update
禁用升级提示:echo ‘DISABLE_UPDATE_PROMPT=true’ >> ~/.zshrc
开启自动升级:echo ‘DISABLE_AUTO_UPDATE=true’ >> ~/.zshrc

安装 powerlevel10k 主题

romkatv/powerlevel10k: A Zsh theme

powerlevel10k,让我们的终端(zsh)更加的五彩斑斓(HuaLiHuShao):

我们已经安装 Oh My Zsh 框架,因此采用与之相关的安装方法(其他安装方法参考 powerlevel10k/README.md at master · romkatv/powerlevel10k 文档)

# 第一步、安装字体
mkdir -pv /usr/local/share/fonts/powerlevel10k/
wget -P /usr/local/share/fonts/powerlevel10k/ https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
wget -P /usr/local/share/fonts/powerlevel10k/ https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
wget -P /usr/local/share/fonts/powerlevel10k/ https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
wget -P /usr/local/share/fonts/powerlevel10k/ https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf
fc-cache -rf

# 第二步、安装扩展
git clone https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

# 第三步、设置终端使用 MesloLGS 字体
# 比如,GNOME Terminal / Edit => Preferences => <Profiles> => Text => Custom font

# 第四步、修改 ~/.zshrc 配置,设置 ZSH_THEME="powerlevel10k/powerlevel10k"
cp -v ~/.zshrc ~/.zshrc.before.sed
sed -E -i 's%^ZSH_THEME=.+%ZSH_THEME="powerlevel10k/powerlevel10k"%g' ~/.zshrc

# 第五步、运行 zsh 程序
zsh

执行命令 p10k configure 可以重新配置。

参考文献

Z shell – Wikipedia
ohmyzsh/ohmyzsh: 🙃 A delightful community-driven (with 1700+ contributors) framework for managing your zsh configuration.
How to Download Files to Specific Directory Using Wget