欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Linux下超好用shell—oh my zsh美化教程

程序员文章站 2022-05-26 17:54:27
...

zsh安装

先安装zsh

# sudo apt install zsh

然后运行下面的命令,下载一些zsh工具主题插件

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

效果如下

# sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Cloning Oh My Zsh...
Cloning into '/root/.oh-my-zsh'...
remote: Enumerating objects: 1158, done.
remote: Counting objects: 100% (1158/1158), done.
remote: Compressing objects: 100% (1127/1127), done.
remote: Total 1158 (delta 20), reused 1062 (delta 15), pack-reused 0
Receiving objects: 100% (1158/1158), 778.44 KiB | 65.00 KiB/s, done.
Resolving deltas: 100% (20/20), done.

Looking for an existing zsh config...
Using the Oh My Zsh template file and adding it to ~/.zshrc.

Time to change your default shell to zsh:
Do you want to change your default shell to zsh? [Y/n] Y
Changing the shell...
Shell successfully changed to '/usr/bin/zsh'.

         __                                     __
  ____  / /_     ____ ___  __  __   ____  _____/ /_
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / /
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/
                        /____/                       ....is now installed!


Before you scream Oh My Zsh! please look over the ~/.zshrc file to select plugins, themes, and options.

主题美化

配置主题,需要修改~/.zshr文件

vi ~/.zshr

修改后需要运行下面的命令来使用修改

source ~/.zshrc

我使用的是ys主题,效果如下
Linux下超好用shell—oh my zsh美化教程

zsh可用的主题可以通过以下命令查看。

 cd $ZSH/themes/

效果如下:Linux下超好用shell—oh my zsh美化教程

https://terminalsplash.com/ 这个网址可以配置更好看的shell主题

参考资料

oh my zsh 哪些主题比较好看、有特点?
为什么说 zsh 是 shell 中的*?
Windows Terminal美化教程