linux终端zsh美化


zsh 安装与配置,使用 oh-my-zsh 美化终端

https://www.haoyep.com/posts/zsh-config-oh-my-zsh/

1.1 安装基本工具

# 更新软件源
sudo apt update && sudo apt upgrade -y
# 安装 zsh git curl
sudo apt install zsh git curl -y

1.2 设置默认终端为 zsh注意:不要使用 sudo

chsh -s /bin/zsh

1.3 安装 oh-my-zsh

MethodCommand
curl sh -c "$(curl -fsSL https://install.ohmyz.sh/)"
wget sh -c "$(wget -O- https://install.ohmyz.sh/)"
fetch sh -c "$(fetch -o - https://install.ohmyz.sh/)"
国内curl镜像 sh -c "$(curl -fsSL https://gitee.com/pocmon/ohmyzsh/raw/master/tools/install.sh)"
国内wget镜像 sh -c "$(wget -O- https://gitee.com/pocmon/ohmyzsh/raw/master/tools/install.sh)"

1.3 设置主题

根据 What’s the best theme for Oh My Zsh? 中的排名,以及自定义化、美观程度,强烈建议使用 powerlevel10k 主题。

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

1.4 安装插件

1.代码提示zsh -autosuggestions 

# 加速1
git clone https://github.moeyy.xyz/https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# 加速2
git clone https://gh.xmly.dev/https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# 加速3
git clone https://gh.api.99988866.xyz/https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

2.语法高亮zsh-syntax-highlighting

git clone https://github.moeyy.xyz/https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# 加速2
git clone https://gh.xmly.dev/https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# 加速3
git clone https://gh.api.99988866.xyz/https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

3、内置了文件夹快捷跳转插件z、解压任何压缩文件extract 

1.5 配置生效插件

sed "s/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting z extract)/g" ~/.zshrc

 

或者修改  sudo nano ~/.zshrc

 

ZSH_THEME="powerlevel10k/powerlevel10k"
plugins=(git zsh-autosuggestions zsh-syntax-highlighting z extract)

 

 

 

posted @ 2024-12-08 19:40  HVAC_Coder  阅读(219)  评论(0)    收藏  举报