前言
由于zsh使用起来实在是太香,所以想要给zsh美化一下以及添加一些插件
美化
目前找到比较快捷以及方便配置的是powerlevel10k
首先,将仓库克隆到本地
克隆powerlevel10k仓库
如果有代理,那么可以直接克隆原始仓库(推荐)
$ git config --global http.proxy http://127.0.0.1:10808 #git代理
$ git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
正克隆到 '/home/charity/powerlevel10k'...
remote: Enumerating objects: 92, done.
remote: Counting objects: 100% (92/92), done.
remote: Compressing objects: 100% (75/75), done.
remote: Total 92 (delta 18), reused 63 (delta 13), pack-reused 0 (from 0)
接收对象中: 100% (92/92), 349.80 KiB | 76.00 KiB/s, 完成.
处理 delta 中: 100% (18/18), 完成.如果没有代理也可以使用Gitee克隆
$ git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ~/powerlevel10k
正克隆到 '/home/charity/powerlevel10k'...
remote: Enumerating objects: 92, done.
remote: Counting objects: 100% (92/92), done.
remote: Compressing objects: 100% (74/74), done.
remote: Total 92 (delta 17), reused 55 (delta 14), pack-reused 0 (from 0)
接收对象中: 100% (92/92), 350.47 KiB | 257.00 KiB/s, 完成.
处理 delta 中: 100% (17/17), 完成.下载并安装字体(可选)
下载下面的4个字体
安装各个字体(使用KDE Plasma 6.3.6演示)
操作完成后重启Konsole
在Konsole中按下Ctrl+Shift+,来打开配置页面:




操作完成后重启Konsole
对于非KDE Plasma用户,可以查看官方文档
安装powerlevel10k到zsh
使用以下命令:
$ echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >> ~/.zshrc完成后重启Konsole(终端仿真器)
如无意外,应该可以出现p10k配置页面
根据个人选择喜欢的样式
如果安装了字体,那么在配置页面的字体显示应无问题
插件
插件推荐2个
下载
克隆仓库:
$ git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting安装
$ echo "source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh" >> ~/.p10k.zsh
$ echo "source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.p10k.zsh如无意外,插件应该已经安装成功,重启终端仿真器检查插件是否已经工作:
