Skip to content
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

Support changing color of the Git action part of the prompt #486

Merged
merged 2 commits into from Oct 14, 2019

Conversation

ashb
Copy link
Contributor

@ashb ashb commented Jul 17, 2019

I do a lot of rebasing and cherry-picking and I like to know when I'm in that mode, so I added an option to make it stand out more.

A picture is worth a thousand words:

Screenshot 2019-07-17 at 11 03 54

@ashb ashb changed the title Support changing colour of git action Support changing colour of git action (rebase, cherry-pick) Aug 14, 2019
@ashb
Copy link
Contributor Author

ashb commented Sep 18, 2019

@mafredri @sindresorhus Could you take a look please? Small PR to change the color of the "you are in the middle of a rebase" marker.

@sindresorhus sindresorhus changed the title Support changing colour of git action (rebase, cherry-pick) Support changing color of the Git action (rebase, cherry-pick) part Sep 23, 2019
@sindresorhus
Copy link
Owner

Can you also add it to the ASCII diagram in https://github.com/sindresorhus/pure#colors?

pure.zsh Outdated Show resolved Hide resolved
Copy link
Collaborator

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, I think this is a great change and one I will likely use myself 😄.

preprompt_parts+=("%F{$git_color}"'${prompt_pure_vcs_info[branch]}${prompt_pure_git_dirty}%f')
local branch="%F{$git_color}"'${prompt_pure_vcs_info[branch]}'
if [[ -n $prompt_pure_vcs_info[action] ]]; then
branch+="|%F{$prompt_pure_colors[git:action]}"'$prompt_pure_vcs_info[action]'"%F{$git_color}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've considered it good practice to end all %F with %f, but there are probably no real benefits there. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given it was used on the next line in a format that does end with %f I didn't think it necessary here.

pure.zsh Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
@sindresorhus sindresorhus changed the title Support changing color of the Git action (rebase, cherry-pick) part Support changing color of the Git action part of the prompt Oct 14, 2019
@sindresorhus sindresorhus merged commit 72f59dd into sindresorhus:master Oct 14, 2019
@sindresorhus
Copy link
Owner

Nice work :)

kgrz added a commit to kgrz/pure that referenced this pull request Dec 11, 2019
* upstream/master:
  Renice the async worker (sindresorhus#505)
  Add zstyle color support to PS2 (sindresorhus#481)
  Improve issue template and system reporting (sindresorhus#517)
  Guard against (ana)conda changing PS1 (sindresorhus#516)
  1.11.0
  Add coloring for git dirty-asterisk (sindresorhus#491)
  Support changing color of the Git action part of the prompt (sindresorhus#486)
  Use ellipsis for continuation prompt (PS2) (sindresorhus#493)
  Fix missing ─ in readme color diagram
  Fix extra space in color diagram of readme
  Simplify the setup phase in the readme (sindresorhus#494)
  Use box characters for prompt diagram in the readme (sindresorhus#495)
@ashb ashb deleted the git-action-color branch June 5, 2020 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants