1
0
Fork 0

API change, and move the ashleydev format into the plugin as the default format.

- usage is now: PROMPT="$(git_prompt_info2) >".
  The legacy git-prompt-old.theme.zsh is using the git_prompt_info() function
  name and I don't want to override that so I set mine to git_prompt_info2
pull/2/head
Ashley Dev 14 years ago
parent 51e7a6ebe1
commit 8d819d2b07

@ -2,7 +2,7 @@
# FILE: git-prompt.plugin.zsh # FILE: git-prompt.plugin.zsh
# DESCRIPTION: oh-my-zsh git information for your PROMPT. # DESCRIPTION: oh-my-zsh git information for your PROMPT.
# AUTHOR: Ashley Dev (the.ashley.dev+git-prompt@gmail.com) # AUTHOR: Ashley Dev (the.ashley.dev+git-prompt@gmail.com)
# VERSION: 2.1 # VERSION: 3.0
# SCREENSHOT: http://i.imgur.com/Yw1KG.png # SCREENSHOT: http://i.imgur.com/Yw1KG.png
# http://i.imgur.com/wx6MU.png # http://i.imgur.com/wx6MU.png
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -18,43 +18,37 @@
# #
# # this is a simple example PROMPT with only git # # this is a simple example PROMPT with only git
# # info from this plugin in it: # # info from this plugin in it:
# PROMPT='$_GIT_PROMPT_INFO# ' # PROMPT='$(git_prompt_info2)# '
# #
# #GIT_PROMPT_SHORTCIRCUIT='off' # # if you want to override the default format you can define your own
# # # _git_prompt_info() function that sets $_GIT_PROMPT_INFO with your format
# # GIT_PROMPT_INFO_FUNC must be set to the # _git_prompt_info ()
# # function that defines your prompt info
# # in order to turn this plugin on.
# GIT_PROMPT_INFO_FUNC='update__GIT_PROMPT_INFO'
#
# local _GIT_PROMPT_INFO=''
# update__GIT_PROMPT_INFO ()
# { # {
# git_prompt__branch # git_prompt__branch
# local b=$GIT_PROMPT_BRANCH # local branch_=$GIT_PROMPT_BRANCH
# #
# git_prompt__dirty_state # git_prompt__dirty_state
# local w=$GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY # local work_=$GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY
# local i=$GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY # local index_=$GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY
# #
# # Reset color # # Reset color
# local R="%{$terminfo[sgr0]%}" # local R="%{$terminfo[sgr0]%}"
# #
# if [[ "$i" = "yes" ]]; then # if [[ "$index_" = "yes" ]]; then
# i="%{$bold_color$fg[red]%}+$R" # index_="%{$bold_color$fg[red]%}+$R"
# else # else
# i="" # index_=""
# fi # fi
# #
# if [[ -n "$b" ]]; then # if [[ -n "$branch_" ]]; then
# if [[ "$w" = 'yes' ]]; then # if [[ "$work_" = 'yes' ]]; then
# b="%{$fg_no_bold[red]%}$b$R" # branch_="%{$fg_no_bold[red]%}$branch_$R"
# elif [[ "$w" = 'no' ]]; then # elif [[ "$work_" = 'no' ]]; then
# b="%{$fg_no_bold[green]%}$b$R" # branch_="%{$fg_no_bold[green]%}$branch_$R"
# fi # fi
# fi # fi
# #
# __GIT_PROMPT_INFO="$R($b$i)$R" # _GIT_PROMPT_INFO="$R($branch_$index_)$R"
# } # }
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# #
@ -87,15 +81,17 @@ git_prompt__git_dir ()
# sets GIT_PROMPT_UPSTREAM_STATE # sets GIT_PROMPT_UPSTREAM_STATE
# #
# output format: # output format:
# A "<" indicates you are behind, ">" indicates you are ahead, "<>" # A "-1" indicates you are behind by one commit, "+3" indicates you are ahead by
# indicates you have diverged, "=" indicates no divergence, and "" indicates # 3 commits, "-1+3" indicates you have diverged, "=" indicates no divergence,
# there is no upstream or this feature is turned 'off' (see below). # and "" indicates there is no upstream or this feature is turned 'off' (see
# below).
# #
# You can control behaviour by setting GIT_PROMPT_SHOWUPSTREAM to a # You can control behaviour by setting GIT_PROMPT_SHOWUPSTREAM to a
# space-separated list of values: # space-separated list of values:
# off no output # off no output
# verbose show number of commits ahead/behind (+/-) upstream instead # simple Instead of '+/-', a "<" indicates you are behind, ">"
# of using "<" and ">". # indicates you are ahead, "<>" indicates you have diverged,
# "=" indicates no divergence.
# legacy don't use the '--count' option available in recent # legacy don't use the '--count' option available in recent
# versions of git-rev-list # versions of git-rev-list
# git always compare HEAD to @{upstream} # git always compare HEAD to @{upstream}
@ -104,7 +100,7 @@ git_prompt__git_dir ()
# if it can find one, or @{upstream} otherwise. Once you have # if it can find one, or @{upstream} otherwise. Once you have
# set GIT_PROMPT_SHOWUPSTREAM, you can override it on a # set GIT_PROMPT_SHOWUPSTREAM, you can override it on a
# per-repository basis by setting the prompt.showUpstream config # per-repository basis by setting the prompt.showUpstream config
# variable (i.e. `git config prompt.showUpstream 'verbose legacy'`). # variable (i.e. `git config prompt.showUpstream 'simple legacy'`).
# #
# git_prompt__upstream accepts 0 or 1 arguments. If an argument is given, it # git_prompt__upstream accepts 0 or 1 arguments. If an argument is given, it
# must be a string of the form specified above for GIT_PROMPT_SHOWUPSTREAM. # must be a string of the form specified above for GIT_PROMPT_SHOWUPSTREAM.
@ -120,7 +116,7 @@ git_prompt__upstream ()
local key value local key value
local svn_remote svn_url_pattern count n local svn_remote svn_url_pattern count n
local upstream=git legacy="" verbose="" local upstream=git legacy="" simple=""
local p local p
# get some config options from git-config # get some config options from git-config
@ -146,7 +142,7 @@ git_prompt__upstream ()
case "$option" in case "$option" in
off) return ;; off) return ;;
git|svn) upstream="$option" ;; git|svn) upstream="$option" ;;
verbose) verbose=1 ;; simple) simple=1 ;;
legacy) legacy=1 ;; legacy) legacy=1 ;;
esac esac
done done
@ -181,7 +177,7 @@ git_prompt__upstream ()
fi fi
# calculate the result # calculate the result
if [[ -z "$verbose" ]]; then if [[ -n "$simple" ]]; then
case "$count" in case "$count" in
"") # no upstream "") # no upstream
p="" ;; p="" ;;
@ -228,34 +224,34 @@ git_prompt__rebase_info ()
return return
fi fi
local r="" local rebase_=""
local g="$(git_prompt__git_dir)" local dir_="$(git_prompt__git_dir)"
if [[ -n "$g" ]]; then if [[ -n "$dir_" ]]; then
if [[ -f "$g/rebase-merge/interactive" ]]; then if [[ -f "$dir_/rebase-merge/interactive" ]]; then
r="|REBASE-i" rebase_="|REBASE-i"
elif [[ -d "$g/rebase-merge" ]]; then elif [[ -d "$dir_/rebase-merge" ]]; then
r="|REBASE-m" rebase_="|REBASE-m"
else else
if [[ -d "$g/rebase-apply" ]]; then if [[ -d "$dir_/rebase-apply" ]]; then
if [[ -f "$g/rebase-apply/rebasing" ]]; then if [[ -f "$dir_/rebase-apply/rebasing" ]]; then
r="|REBASE" rebase_="|REBASE"
elif [[ -f "$g/rebase-apply/applying" ]]; then elif [[ -f "$dir_/rebase-apply/applying" ]]; then
r="|AM" rebase_="|AM"
else else
r="|AM/REBASE" rebase_="|AM/REBASE"
fi fi
elif [[ -f "$g/MERGE_HEAD" ]]; then elif [[ -f "$dir_/MERGE_HEAD" ]]; then
r="|MERGING" rebase_="|MERGING"
elif [[ -f "$g/CHERRY_PICK_HEAD" ]]; then elif [[ -f "$dir_/CHERRY_PICK_HEAD" ]]; then
r="|CHERRY-PICKING" rebase_="|CHERRY-PICKING"
elif [[ -f "$g/BISECT_LOG" ]]; then elif [[ -f "$dir_/BISECT_LOG" ]]; then
r="|BISECTING" rebase_="|BISECTING"
fi fi
fi fi
fi fi
GIT_PROMPT_REBASE_INFO=$r GIT_PROMPT_REBASE_INFO=$rebase_
} }
# sets GIT_PROMPT_BRANCH # sets GIT_PROMPT_BRANCH
@ -275,17 +271,17 @@ git_prompt__branch ()
return return
fi fi
local b="" local branch_=""
local g="$(git_prompt__git_dir)" local dir_="$(git_prompt__git_dir)"
if [[ -n "$g" ]]; then if [[ -n "$dir_" ]]; then
if [[ -f "$g/rebase-merge/interactive" ]]; then if [[ -f "$dir_/rebase-merge/interactive" ]]; then
b="$(cat "$g/rebase-merge/head-name")" branch_="$(cat "$dir_/rebase-merge/head-name")"
elif [[ -d "$g/rebase-merge" ]]; then elif [[ -d "$dir_/rebase-merge" ]]; then
b="$(cat "$g/rebase-merge/head-name")" branch_="$(cat "$dir_/rebase-merge/head-name")"
else else
b="$(git symbolic-ref HEAD 2>/dev/null)" || { branch_="$(git symbolic-ref HEAD 2>/dev/null)" || {
b="$( branch_="$(
case "${GIT_PROMPT_DESCRIBE_STYLE-}" in case "${GIT_PROMPT_DESCRIBE_STYLE-}" in
(contains) (contains)
git describe --contains HEAD ;; git describe --contains HEAD ;;
@ -297,21 +293,21 @@ git_prompt__branch ()
git describe --tags --exact-match HEAD ;; git describe --tags --exact-match HEAD ;;
esac 2>/dev/null)" || esac 2>/dev/null)" ||
b="$(cut -c1-7 "$g/HEAD" 2>/dev/null)" || branch_="$(cut -c1-7 "$dir_/HEAD" 2>/dev/null)" ||
b="$b" branch_="$branch_"
} }
fi fi
b=${b##refs/heads/} branch_=${branch_##refs/heads/}
if [[ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]]; then if [[ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]]; then
if [[ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]]; then if [[ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]]; then
b="BARE:$b" branch_="BARE:$branch_"
else else
b="GIT_DIR!" branch_="GIT_DIR!"
fi fi
fi fi
fi fi
GIT_PROMPT_BRANCH=$b GIT_PROMPT_BRANCH=$branch_
} }
@ -349,32 +345,6 @@ git_prompt__stash ()
# to gather information about a large repository. When this happens the # to gather information about a large repository. When this happens the
# short-circuit logic will display a warning and turn off the showing of dirty # short-circuit logic will display a warning and turn off the showing of dirty
# state in your git prompt (for the local repo only). # state in your git prompt (for the local repo only).
#
# NOTE: To make the short-circuit logic work, the GIT_PROMPT_INFO_FUNC function
# must set a global variable (with your git prompt format), rather than echo it.
# Correct:
#
# PROMPT='$__GIT_PROMPT_INFO > '
#
# # this function sets $__GIT_PROMPT_INFO
# function update_prompt_func ()
# {
# #...
# __GIT_PROMPT_INFO="$info"
# }
# GIT_PROMPT_INFO_FUNC=update_prompt_func
#
# Incorrect:
#
# PROMPT='$(update_prompt_func) > '
#
# function update_prompt_func ()
# {
# #...
# echo "$info"
# }
# GIT_PROMPT_INFO_FUNC=update_prompt_func
#
local _big_repo='init' local _big_repo='init'
__git_prompt_shortcircuit () __git_prompt_shortcircuit ()
{ {
@ -391,7 +361,7 @@ __git_prompt_shortcircuit ()
echo '' > /dev/stderr echo '' > /dev/stderr
git config prompt.showDirtyState 'false' git config prompt.showDirtyState 'false'
$GIT_PROMPT_INFO_FUNC _git_prompt_info
fi fi
fi fi
} }
@ -421,8 +391,8 @@ git_prompt__dirty_state ()
return return
fi fi
local g="$(git_prompt__git_dir)" local dir_="$(git_prompt__git_dir)"
if [[ -z "$g" ]]; then if [[ -z "$dir_" ]]; then
return return
fi fi
if [[ "$GIT_PROMPT_SHOWDIRTYSTATE" = 'off' ]]; then if [[ "$GIT_PROMPT_SHOWDIRTYSTATE" = 'off' ]]; then
@ -494,6 +464,108 @@ git_prompt__dirty_state ()
_big_repo='' _big_repo=''
} }
#------------------ Default Prompt Format ------------------
# You can override this by defining your own _git_prompt_info in your theme that
# sets $_GIT_PROMPT_INFO.
# You can override these colors if you like too.
# Colors ('_C' for color):
if [[ "$DISABLE_COLOR" != "true" ]]; then
# git prompt info colors:
local _Cerror_="%{$fg[yellow]%}" # bad (empty) .git/ directory
local _Cbranch_new_repo_="%{$fg_bold[default]%}" # branch color of new repo
local _Cbranch_clean_="%{$fg_no_bold[green]%}" # branch color when clean
local _Cbranch_dirty_="%{$fg_no_bold[red]%}" # branch color when dirty
local _Crebase_="%{$bold_color$fg[yellow]%}" # rebase info
local _Cindex_="%{$bold_color$fg[red]%}" # index info
local _Cuntracked_clean_="" # untracked files state when clean
local _Cuntracked_dirty_="%{$fg_bold[red]%}" # untracked files state when dirty
local _Cupstream_="%{${fg[cyan]}%}" # upstream info
local _Cstash_="" # stash state
# Reset formating:
local R="%{$terminfo[sgr0]%}"
fi
# sets _GIT_PROMPT_INFO
_git_prompt_info ()
{
local dir_="$(git_prompt__git_dir)"
if [ -z "$dir_" ]; then
_GIT_PROMPT_INFO=''
return
fi
git_prompt__stash
local stash_=$GIT_PROMPT_STASH_STATE_DIRTY
git_prompt__upstream
local upstream_=$GIT_PROMPT_UPSTREAM_STATE
git_prompt__branch
local branch_=$GIT_PROMPT_BRANCH
git_prompt__rebase_info
local rebase_=$GIT_PROMPT_REBASE_INFO
git_prompt__dirty_state
local work_=$GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY
local index_=$GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY
local untracked_=$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED
local freshy_=$GIT_PROMPT_DIRTY_STATE_FRESH_REPO
if [ -z "$branch_$index_$work_$untracked_" ]; then
if [ -n "$dir_" ]; then
_GIT_PROMPT_INFO="$R$_Cerror_(Error: bad ./$dir_ dir)$R"
return
fi
fi
if [ "$stash_" = 'yes' ]; then
stash_="$_Cstash_\$$R"
else
stash_=""
fi
if [ -n "$upstream_" ]; then
upstream_="$_Cupstream_$upstream_$R"
fi
if [ "$index_" = "yes" ]; then
index_="$_Cindex_+$R"
else
index_=""
fi
if [ -n "$branch_" ]; then
if [ "$freshy_" = "yes" ]; then
# this is a fresh repo, nothing here...
branch_="$_Cbranch_new_repo_$branch_$R"
elif [ "$work_" = 'yes' ]; then
branch_="$_Cbranch_dirty_$branch_$R"
elif [ "$work_" = 'no' ]; then
branch_="$_Cbranch_clean_$branch_$R"
fi
fi
if [ -n "$rebase_" ]; then
rebase_="$_Crebase_$rebase_$R"
fi
local _prompt="$branch_$rebase_$index_$stash_$upstream_"
# add ( ) around _prompt:
if [ "$untracked_" = "yes" ]; then
_prompt="$_Cuntracked_dirty_($_prompt$_Cuntracked_dirty_)"
elif [ "$untracked_" = "no" ]; then
_prompt="$_Cuntracked_clean_($_prompt$_Cuntracked_clean_)"
else
_prompt="($_prompt)"
fi
_GIT_PROMPT_INFO="$R$_prompt$R"
}
#------------------ Fast Prompt ------------------ #------------------ Fast Prompt ------------------
# This section sets up some functions that get called infrequently as possible # This section sets up some functions that get called infrequently as possible
# and therefore don't slow your prompt down as you are using zsh. # and therefore don't slow your prompt down as you are using zsh.
@ -512,8 +584,6 @@ precmd_functions+='_git_prompt__precmd_update_git_vars'
chpwd_functions+="_git_prompt_info" chpwd_functions+="_git_prompt_info"
PERIOD=15 PERIOD=15
periodic_functions+="_git_prompt_info" periodic_functions+="_git_prompt_info"
_git_prompt_info () { $GIT_PROMPT_INFO_FUNC }
_git_prompt_info _git_prompt_info
_git_prompt__precmd_update_git_vars() _git_prompt__precmd_update_git_vars()
@ -521,10 +591,10 @@ _git_prompt__precmd_update_git_vars()
if [[ $ZSH_VERSION = *\ 4.2* ]]; then if [[ $ZSH_VERSION = *\ 4.2* ]]; then
# some older versions of zsh don't have periodic_functions, so do the # some older versions of zsh don't have periodic_functions, so do the
# slow path if that's the case: # slow path if that's the case:
$GIT_PROMPT_INFO_FUNC _git_prompt_info
elif [[ -n "$__EXECUTED_GIT_COMMAND" ]]; then elif [[ -n "$__EXECUTED_GIT_COMMAND" ]]; then
$GIT_PROMPT_INFO_FUNC _git_prompt_info
unset __EXECUTED_GIT_COMMAND unset __EXECUTED_GIT_COMMAND
fi fi
} }
@ -536,7 +606,11 @@ _git_prompt__preexec_update_git_vars ()
rm*) __EXECUTED_GIT_COMMAND=1 ;; rm*) __EXECUTED_GIT_COMMAND=1 ;;
touch*) __EXECUTED_GIT_COMMAND=1 ;; touch*) __EXECUTED_GIT_COMMAND=1 ;;
mkdir*) __EXECUTED_GIT_COMMAND=1 ;; mkdir*) __EXECUTED_GIT_COMMAND=1 ;;
echo*) __EXECUTED_GIT_COMMAND=1 ;;
esac esac
} }
#-------------------------------------------------- #--------------------------------------------------
git_prompt_info2() { echo $_GIT_PROMPT_INFO }

@ -3,7 +3,7 @@
# DESCRIPTION: oh-my-zsh prompt theme, shows vi mode, last shell return code, # DESCRIPTION: oh-my-zsh prompt theme, shows vi mode, last shell return code,
# and verbose git info. # and verbose git info.
# AUTHOR: Ashley Dev (the.ashley.dev+zsh-theme@gmail.com) # AUTHOR: Ashley Dev (the.ashley.dev+zsh-theme@gmail.com)
# VERSION: 2.1 # VERSION: 3.0
# SCREENSHOT: http://i.imgur.com/Yw1KG.png # SCREENSHOT: http://i.imgur.com/Yw1KG.png
# http://i.imgur.com/wx6MU.png # http://i.imgur.com/wx6MU.png
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -14,18 +14,6 @@
#-------------------- Colors ---------------------- #-------------------- Colors ----------------------
# Colors ('_C' for color): # Colors ('_C' for color):
if [[ "$DISABLE_COLOR" != "true" ]]; then if [[ "$DISABLE_COLOR" != "true" ]]; then
# git prompt info colors:
local _Cerror_="%{$fg[yellow]%}" # bad (empty) .git/ directory
local _Cb_new_repo_="%{$fg_bold[default]%}" # branch color of new repo
local _Cb_clean_="%{$fg_no_bold[green]%}" # branch color when clean
local _Cb_dirty_="%{$fg_no_bold[red]%}" # branch color when dirty
local _Cr_="%{$bold_color$fg[yellow]%}" # rebase info
local _Ci_="%{$bold_color$fg[red]%}" # index info
local _Cu_clean_="" # untracked files state when clean
local _Cu_dirty_="%{$fg_bold[red]%}" # untracked files state when dirty
local _Cp_="%{${fg[cyan]}%}" # upstream info
local _Cs_="" # stash state
# Reset formating: # Reset formating:
local R="%{$terminfo[sgr0]%}" local R="%{$terminfo[sgr0]%}"
@ -44,95 +32,6 @@ if [[ "$DISABLE_COLOR" != "true" ]]; then
local _Cvi_mode_="%{$fg_bold[cyan]%}" local _Cvi_mode_="%{$fg_bold[cyan]%}"
fi fi
#-----------------------------------------------------
# git prompt info:
# The git prompt plugin will cause $GIT_PROMPT_INFO_FUNC to be called
# when $_GIT_PROMPT_INFO needs to be updated.
GIT_PROMPT_INFO_FUNC="update__GIT_PROMPT_INFO"
GIT_PROMPT_SHOWUPSTREAM="verbose"
GIT_PROMPT_SHORTCIRCUIT='on'
local _GIT_PROMPT_INFO=''
# will set _GIT_PROMPT_INFO
update__GIT_PROMPT_INFO ()
{
local g="$(git_prompt__git_dir)"
if [ -z "$g" ]; then
_GIT_PROMPT_INFO=''
return
fi
git_prompt__stash
local s=$GIT_PROMPT_STASH_STATE_DIRTY
git_prompt__upstream
local p=$GIT_PROMPT_UPSTREAM_STATE
git_prompt__branch
local b=$GIT_PROMPT_BRANCH
git_prompt__rebase_info
local r=$GIT_PROMPT_REBASE_INFO
git_prompt__dirty_state
local w=$GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY
local i=$GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY
local u=$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED
local f=$GIT_PROMPT_DIRTY_STATE_FRESH_REPO
if [ -z "$b$i$w$u" ]; then
if [ -n "$g" ]; then
_GIT_PROMPT_INFO="$R$_Cerror_(Error: bad ./$g dir)$R"
return
fi
fi
if [ "$s" = 'yes' ]; then
s="$_Cs_\$$R"
else
s=""
fi
if [ -n "$p" ]; then
p="$_Cp_$p$R"
fi
if [ "$i" = "yes" ]; then
i="$_Ci_+$R"
else
i=""
fi
if [ -n "$b" ]; then
if [ "$f" = "yes" ]; then
# this is a fresh repo, nothing here...
b="$_Cb_new_repo_$b$R"
elif [ "$w" = 'yes' ]; then
b="$_Cb_dirty_$b$R"
elif [ "$w" = 'no' ]; then
b="$_Cb_clean_$b$R"
fi
fi
if [ -n "$r" ]; then
r="$_Cr_$r$R"
fi
local _prompt="$b$r$i$s$p"
# add ( ) around _prompt:
if [ "$u" = "yes" ]; then
_prompt="$_Cu_dirty_($_prompt$_Cu_dirty_)"
elif [ "$u" = "no" ]; then
_prompt="$_Cu_clean_($_prompt$_Cu_clean_)"
else
_prompt="($_prompt$)"
fi
_GIT_PROMPT_INFO="$R$_prompt$R"
}
#-------------------- PROMPT definition: ---------------------- #-------------------- PROMPT definition: ----------------------
# #
local user_="%(!.$_Cuser_root_.$_Cuser_)%n$R" local user_="%(!.$_Cuser_root_.$_Cuser_)%n$R"
@ -140,7 +39,7 @@ local host_="%(!.$_Chost_root_.$_Chost_)%m$R"
local path_="%(!.$_Cpath_root_.$_Cpath_)%~$R" local path_="%(!.$_Cpath_root_.$_Cpath_)%~$R"
local jobs_="%(1j.$_Cjobs_%j$R.)" local jobs_="%(1j.$_Cjobs_%j$R.)"
PROMPT='$user_$host_$path_ $_GIT_PROMPT_INFO$jobs_# ' PROMPT='$user_$host_$path_ $(git_prompt_info2)$jobs_# '
local date_format_='%D{%a %b %d}, %*' local date_format_='%D{%a %b %d}, %*'
local date_="${_Cdate_}[$date_format_]$R" local date_="${_Cdate_}[$date_format_]$R"
@ -150,4 +49,3 @@ RPROMPT='$return_code_$date_'
# use the vi-mode oh-my-zsh plugin to get this: # use the vi-mode oh-my-zsh plugin to get this:
MODE_INDICATOR="${_Cvi_mode_}-- CMD MODE -- $R" MODE_INDICATOR="${_Cvi_mode_}-- CMD MODE -- $R"

Loading…
Cancel
Save