Linux shell美化 zsh+oh-my-zsh+power10k

美化效果示意:
在这里插入图片描述

安装zsh

安装

sudo apt-get install zsh

将默认的shell改为zsh

chsh -s /bin/zsh

安装on-my-zsh

on-my-zsh官方网站

  • 第一种 通过curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  • 第二种 通过wget
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

安装power10k主题

安装power10k

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

镜像下载:

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

oh-my-zsh主题改为power10k

```shell
vim ~/.zshr
```

将`ZSH_THEME`从`robbyrussell`改为`powerlevel10k/powerlevel10k`
```shell
ZSH_THEME="powerlevel10k/powerlevel10k”
```

这里vim使用,打开后按i进入插入模式,将以上完成后,按esc,输入 :wq 再回车即可完成修改

字体 设置

安装字体

  • 推荐字体 MesloLGS NF
    github链接
    gitee链接

    一次下载四个字体包,打开进行安装
    在这里插入图片描述

  • 备选:直接安装nerd font,使用广泛且兼容性较好,但是这里是完整安装,文件较大

    git clone https://github.com/ryanoasis/nerd-fonts.git --depth 1
    cd nerd-fonts
    ./install.sh
    

配置字体

打开terminal,修改custom fontMesloLGS NF或者第二种方法就为图中的字体

在这里插入图片描述

如果使用wsl则通过powershell里打开设置
在这里插入图片描述
从ubuntu外观里修改字体即可
在这里插入图片描述

power10k配置

通过如下命令即可进入配置power10k主题,根据自己的喜好选择即可。
当想重新进行设置时再次输入该命令即可重新配置

p10k configure

在这里插入图片描述

相关插件安装

zsh-autosuggestions

记录你之前输入过的所有命令,并且自动匹配你可能想要输入命令,然后按→补全
安装:

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

配置:在 ~/.zshrc 中配置

plugins=(其他的插件 zsh-syntax-highlighting)

zsh-syntax-highlighting

这个插件直接在输入过程中就会提示你,当前命令是否正确,错误红色,正确绿色

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

配置:在 ~/.zshrc 中配置

plugins=(其他的插件 zsh-autosuggestions)

安装插件完成,重新加载配置文件

source ~/.zshrc

相关推荐

  1. LinuxShell编程中source和export命令

    2024-01-18 14:02:03       18 阅读
  2. Windows 11 轻量简单的美化方案

    2024-01-18 14:02:03       12 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-18 14:02:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-18 14:02:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-18 14:02:03       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-18 14:02:03       20 阅读

热门阅读

  1. 2. Git

    2. Git

    2024-01-18 14:02:03      34 阅读
  2. Python学习之路-正则表达式

    2024-01-18 14:02:03       38 阅读
  3. vue3 系列:Vue3 官方文档速通

    2024-01-18 14:02:03       29 阅读
  4. Kafka生产者

    2024-01-18 14:02:03       30 阅读
  5. 【架构设计】单体软件分布式化思考

    2024-01-18 14:02:03       36 阅读
  6. 开发实践7_文件上传

    2024-01-18 14:02:03       30 阅读
  7. Python基础篇 - 列表推导式(List Comprehension)

    2024-01-18 14:02:03       32 阅读
  8. 华为HCIE课堂笔记第十六章 Qos基本原理

    2024-01-18 14:02:03       22 阅读
  9. helm中的_helpers.tpl文件语法解析

    2024-01-18 14:02:03       31 阅读