自定义 Zsh + Oh My Zsh 但无法获取更新

问题描述

我是 Zsh + Oh My Zsh 的新手,我的提示设置为在几个主题之间随机选择。

ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "kafeitu" "avit")

但是,我对这些进行了一些定制,使它们更像我想要的样子。

这样做的一个副作用是,现在当我收到更新 Zsh 的提示时,我不能:

[oh-my-zsh] Would you like to update? [Y/n] Y
Updating Oh My Zsh
error: Pulling is not possible because you have unmerged files.
hint: Fix them up in the work tree,and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
There was an error updating. Try again later?

如何在自定义主题的同时仍然维护存储库,以便我可以下拉更新?

谢谢。

解决方法

原来在 ~/.oh-my-zsh/custom 目录中有一个自定义文件夹就是为了这个目的。

要自定义众多主题中的一个,您只需将主主题目录 ~/.oh-my-zsh/themes 中的主题复制到 ~/.oh-my-zsh/custom/themes 并根据需要进行编辑。 .zshrc 中的 ZSH_THEME="[theme name]" 设置将首先查看此自定义区域,然后再查看主主题文件夹。

文档:https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-themes