经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 数据库/运维 » Linux/Shell » 查看文章
Archlinux zsh终端美化 powerlevel10k配置
来源:cnblogs  作者:orginly  时间:2021/4/19 8:50:04  对本文有异议

环境

Arch Linux + KDE Plasma

安装zsh

  1. yay -S zsh

更改默认终端

  1. chsh -s /bin/zsh

安装oh-my-zsh-git

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

  1. yay -S oh-my-zsh-git

默认配置

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

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

安装插件

autojump 跳转目录

  1. yay -S autojump

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

  1. yay -S zsh-syntax-highlighting zsh-autosuggestions

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

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

插件配置

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

  1. plugins=(
  2. sudo
  3. git
  4. autojump
  5. zsh-syntax-highlighting
  6. zsh-autosuggestions
  7. )

安装powerlevel10k样式

安装Nerd Fonts字体

下载字体

  1. mkdir -p ~/.local/share/fonts
  2. 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

缓存字体

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

查看是否安装成功

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

设置终端字体

image

下载powerlevel10k

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

修改zsh主题

  1. ZSH_THEME="powerlevel10k/powerlevel10k"
  2. source ~/.zshrc

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

image

注意事项

配置成功后只显示一行

Instant Prompt Mode 选择off

原文链接:http://www.cnblogs.com/orginly/p/14646078.html

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号