oh-my-zsh 安装

1. 安装失败 git clone of oh-my-zsh repo failed

oh-my-zsh 查到的安装基本都是使用的是命令行安装。
比如这个命令:

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

这个命令是先下载install脚本,再执行这个脚本。
脚本中会克隆 ohmyzsh 的仓库,通常情况下执行到这就报错了。
错误提示类似:
git clone of oh-my-zsh repo failed

于是上网查了下,所幸好多人都有这个问题。

2. 解决

参考这个 issue git clone of oh-my-zsh repo failed, 里边有提到一个手动安装的方法 manual-installation

2.1 步骤

具体步骤看个人情况,因为我之前没有zsh 的配置或者说不重要,省去了 manual-installation 中的第二步

# step 1 将代码clone到本地 
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
# step 2 
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
# step 3 
chsh -s $(which zsh)
# step 4 
退出终端,重新打开即可

效果如图:

image.png

3 安装主题

暂没搞定,先记下步骤 有空再整

参考iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

# step 1 
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
// 上边这个非常慢, 也可以使用下边这个代理的来
git clone https://github.91chi.fun/https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

# step 2  编辑.zshrc文件,将 ZSH_THEME="powerlevel10k/powerlevel10k" 复制进去
vi .zshrc

# step 3
重启客户端

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容