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
Method | Command |
---|---|
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 配置生效插件
修改 sudo nano ~/.zshrc
ZSH_THEME="powerlevel10k/powerlevel10k"
plugins=(git zsh-autosuggestions zsh-syntax-highlighting z extract)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义