菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
413
0

Archlinux zsh终端美化 powerlevel10k配置

原创
05/13 14:22
阅读数 64149

环境

Arch Linux + KDE Plasma

安装zsh

yay -S zsh

更改默认终端

chsh -s /bin/zsh

安装oh-my-zsh-git

archlinuxcn源有打好的包,或者使用AUR安装。

yay -S oh-my-zsh-git

默认配置

cp /usr/share/oh-my-zsh/zshrc ~/.zshrc

这时候打开终端软件,应该就会默认进入zsh了

安装插件

autojump 跳转目录

yay -S autojump

命令高亮现和自动建议补全

yay -S zsh-syntax-highlighting zsh-autosuggestions

这两个是zsh插件,使用上面的方式配置是不行的,因为oh-my-zsh找不到这两个插件(会报plugin not found)。为此我们要进行一下特殊处理,创建这两个插件的符号链接到oh-my-zsh的自定义插件目录

sudo ln -s /usr/share/zsh/plugins/zsh-syntax-highlighting /usr/share/oh-my-zsh/custom/plugins/
sudo ln -s /usr/share/zsh/plugins/zsh-autosuggestions /usr/share/oh-my-zsh/custom/plugins/

插件配置

同样是打开.zshrc文件,找到plugins=(git),在这里增加自己想要的插件即可,多个插件名称之间使用空格或者换行分开(不能使用逗号)。
vim ~/.zshrc

plugins=(
	sudo
	git
	autojump
	zsh-syntax-highlighting
	zsh-autosuggestions
)

安装powerlevel10k样式

安装Nerd Fonts字体

下载字体

mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts && curl -fLo "Droid Sans Mono for Powerline Nerd Font Complete.otf" https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf

缓存字体

fc-cache -vf ~/.local/share/fonts/

查看是否安装成功

fc-list | grep -i droid
/home/kylin/.local/share/fonts/Droid Sans Mono for Powerline Nerd Font Complete.otf: DroidSansMonoForPowerline Nerd Font:style=Book

设置终端字体

image

下载powerlevel10k

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

修改zsh主题

ZSH_THEME="powerlevel10k/powerlevel10k"

source ~/.zshrc

重启终端即可进入配置p10k
**p10k configure 以直接从终端访问内置配置向导 **

image

注意事项

配置成功后只显示一行

Instant Prompt Mode 选择off

发表评论

0/200
413 点赞
0 评论
收藏
为你推荐 换一批