mirror of
https://git.decapod.one/brethil/dotfiles
synced 2024-12-22 15:21:30 +01:00
zsh-theme: tweak git prompt
use with DISABLE_UNTRACKED_DIRTY=true
This commit is contained in:
parent
194f058b8a
commit
296bfcfa15
|
@ -19,8 +19,8 @@ local PATH_PROMPT="%F{white}[%F{green}%(4~:…/%3~:%~)%F{white}]%f" # Shows las
|
|||
ZSH_THEME_GIT_PROMPT_PREFIX="%f%{$fg[yellow]%} "
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[white]%} %{$fg[red]%}✗%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[white]%} %{$fg[green]%}√%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[white]%}%{$fg[red]%}x%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[white]%}%{$fg[green]%}√%{$reset_color%}"
|
||||
|
||||
# The following are part of `git_prompt_status`
|
||||
# Rules:
|
||||
|
@ -28,14 +28,13 @@ ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[white]%} %{$fg[green]%}√%{$reset_color%}"
|
|||
# * : modified
|
||||
# + : added
|
||||
# $ : stashed
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%B%F{red}?%b%f" # red
|
||||
# ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[red]%}±" # this is equivalent to DIRTY, if DISABLE_UNTRACKED_FILES_DIRTY is set
|
||||
ZSH_THEME_GIT_PROMPT_ADDED="%B%F{34}+%b%f" # green
|
||||
ZSH_THEME_GIT_PROMPT_STASHED="%B%F{32}$%b%f" # blue
|
||||
# ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[red]%}✗ " # this is equivalent to DIRTY, if DISABLE_UNTRACKED_FILES_DIRTY is set
|
||||
ZSH_THEME_GIT_PROMPT_ADDED="%B%F{34}+%b%f" # green
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%B%F{red}?%b%f" # red
|
||||
|
||||
# The following are part of `git_remote_status`
|
||||
# ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE="%{$fg[green]%}="
|
||||
ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE=""
|
||||
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE="%F{255}>%f"
|
||||
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="%F{255}<%f"
|
||||
ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%F{255}<>%f"
|
||||
|
@ -58,7 +57,7 @@ function virtualenv_info {
|
|||
|
||||
function git_prompt() {
|
||||
if [[ -n "$(git status 2>/dev/null)" ]]; then
|
||||
local GIT_PROMPT="%F{255}($(git_prompt_info)$(git_prompt_status)$(git_remote_status)%F{255})%f"
|
||||
local GIT_PROMPT="%F{255}($(git_prompt_info)%B%F{255}|%f%b$(git_prompt_status)$(git_remote_status)%F{255})%f"
|
||||
echo "$GIT_PROMPT"
|
||||
else
|
||||
echo ""
|
||||
|
|
Loading…
Reference in New Issue
Block a user