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
plugins=(git zsh-autosuggestions zsh-syntax-highlighting z extract)
标签:git,oh,com,https,linux,my,zsh,美化 From: https://www.cnblogs.com/HVAC-Coder/p/18593733