Closed ElSamhaa closed 3 years ago
You can do that by editing my_git_prompt
in ~/.p10k.zsh
. It's fairly straightforward.
@romkatv you mean my_git_format
?
It's my_git_formatter
. A function.
@romkatv I'm not sure how would you do that!
I want to satisfy this criterion:
HEAD
is on main
and in sync with the remote
I'm having a look at my_git_formatter
rn, but are you suggesting that I should remove ~
from POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN
and check the directory under the my_git_formatter
?
are you suggesting that I should remove
~
fromPOWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN
and check the directory under themy_git_formatter
?
yes
@romkatv I looked at the p10k.zsh
file, and sadly I don't think that this requirement can be applied from there.
The closest capability I found there to what I need is DIR CLASSES
, but it just customizes the colors of the prompt.
Have you tried https://github.com/romkatv/powerlevel10k/issues/1632#issuecomment-965683251? What was the problem with this approach?
The script is very declarative -- kudos, so unless the case is captured in a flag, there is not much to be done there.
In other words, I can't figure out how to check for the different conditions under that script, not just the aforementioned function. Maybe we need to have a look at another relevant script.
I need to check:
HEAD
relative to remote
CWD is $PWD
. Status of the git repo is available through these: https://github.com/romkatv/powerlevel10k/blob/f217e4a39a284f6db7be7a4cfde8647085f97865/gitstatus/gitstatus.plugin.zsh#L90-L133
Closing because I believe I've answered all questions here. As per FAQ, customizing git prompt requires editing my_git_formatter
.
The title pretty much sums it up. I want to detect any changes to my dotfiles that aren't in sync with remote.