自用zsh不解释连招

需要自行解决网络环境问题
个人自用,方便后续快速复现

安装zsh

Ubuntu

sudo apt install zsh git curl

Mac用brew, Arch用pacman或者yay/paru,自己适配

设置默认终端为 zsh(注意:不要使用 sudo)。然后注销并重新登录用户,使更改生效。

chsh -s $(which zsh)

安装 oh-my-zsh

sh -c "$(curl -fsSL https://install.ohmyz.sh/)"

遇到问是否改变默认shell选Y

迁移bash配置(懂自懂,不懂不做)

cat ~/.bashrc
vim ~/.zshrc

不解释连招

下载主题和插件

sudo wget -O $ZSH_CUSTOM/themes/haoomz.zsh-theme https://cdn.haoyep.com/gh/leegical/Blog_img/zsh/haoomz.zsh-theme
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

启用主题和插件

vim ~/.zshrc
  • 找到ZSH_THEME=所在行,等号右边改成haoomz
  • 找到'plugins='所在行,等号右边改成(git sudo z extract zsh-autosuggestions zsh-syntax-highlighting)
#...
ZSH_THEME="haoomz"
#...
plugins=(git sudo z extract zsh-autosuggestions zsh-syntax-highlighting)

重启终端或者source ~/.zshrc完事。

source ~/.zshrc

效果预览

image

posted @ 2026-08-19 10:40  凉快李某  阅读(13)  评论(0)    收藏  举报