经常需要配置安装
ZSH,这里放一个自用的安装方法吧,基本上只要复制命令并执行就可以了,不用去手动编辑文件。
包括字体安装,启用
zsh-autosuggestions,zsh-syntax-highlighting
等实用插件。
开始安装
安装依赖
1 2 3 4
| sudo apt update && sudo apt upgrade -y
sudo apt install zsh git curl fonts-powerline -y
|
配置 zsh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
chsh -s $(which zsh) $(whoami)
sh -c "$(curl -fsSL https://install.ohmyz.sh/)"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
sed -i.bak 's/^ZSH_THEME=.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
sed -i.bak 's/^plugins=.*/plugins=(git zsh-autosuggestions zsh-syntax-highlighting z extract)/' ~/.zshrc
|
新开个终端,会自动提示主题配置。如果没提示,手动运行:
END
完工。
如果是使用 Xshell 远程连接,建议在本地主机安装支持图标的字体,比如
NerdFont。
随后,编辑连接配置,手动指定一下字体。