-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for more contexts #4
base: master
Are you sure you want to change the base?
Conversation
First support of new contexts
Don't know if this is really usefull or not
Hi @couloum. I know these context exist in prezto's git-info, but I think it's too much information and I prefer to keep it simple, like we try to keep it simple in zimfw. (I was considering adding an unmerged context, so files with merge conflict show up in this context instead of both indexed and unindexed, but I'm still thinking it twice and didn't implement it yet.) Any new context need to be used in at least a couple of our themes for it to make sense. Of course all these context proposed here could be added to the sorin theme. But I specially like how our fork of sorin is less poluted with symbols than the original prezto version. EDIT: Also, these new context require the verbose mode, which makes the prompt slower when enabled, so we try to avoid it. In fact, only our forks of the steeef and sorin themes use it. |
Thank you for your prompt answer. I understand the philosophy to have minimal and non-bloated framework. I currently use prezto and consider using zimfw especially for that. I do have created my own prompt in prezto that do contains these contexts. Therefore I added them for myself and suggested a PR to have this integrated mainstream. But I can leave with my own fork. I let you decide whether or not you should validate this PR. |
I'll leave this open to see if there's any interest in it. You can always use prezto's git-info instead of ours with: .zimrc
.zshrc (on top)
|
if [[ ${line:0:1} == 'A' ]] ((added++)) | ||
if [[ ${line:0:1} == 'M' ]] ((modified++)) | ||
if [[ ${line:1:1} == 'M' ]] ((modified++)) | ||
if [[ ${line:0:1} == 'D' ]] ((deleted++)) | ||
if [[ ${line:1:1} == 'D' ]] ((deleted++)) | ||
if [[ ${line:0:1} == 'R' ]] ((renamed++)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this might be tricker that what's implemented here. Sorin came up with this at the time:
I suggest this PR to add support for the following new contexts:
These contexts are only available when verbose is set to
yes
.I used the same code letters than original prezto/git module for a better compatibility.
With this PR, we can have more information on the 'dirty' state as we now see the different reasons of why a repo is dirty.
Example of prompt: