mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-06 02:51:32 +01:00
add zsh and kubectl prompts to agnoster prompt
This commit is contained in:
parent
f1e69071c7
commit
7bafb5e1d4
2 changed files with 15 additions and 4 deletions
|
|
@ -107,6 +107,14 @@ prompt_git() {
|
|||
#PL_BRANCH_CHAR=$'\ue0a0' #
|
||||
PL_BRANCH_CHAR=$'\u2693' # anchor
|
||||
}
|
||||
|
||||
if [[ ! -z "${ZSH_GIT_PROMPT}" ]]; then
|
||||
# just use zsh-git-prompt with our segment coloring
|
||||
prompt_segment yellow red
|
||||
echo -n ${PL_BRANCH_CHAR} ${ZSH_GIT_PROMPT}
|
||||
return
|
||||
fi
|
||||
|
||||
local ref dirty mode repo_path
|
||||
|
||||
if [[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]]; then
|
||||
|
|
@ -138,11 +146,16 @@ prompt_git() {
|
|||
zstyle ':vcs_info:*' formats ' %u%c'
|
||||
zstyle ':vcs_info:*' actionformats ' %u%c'
|
||||
vcs_info
|
||||
echo -n "${ref/refs\/heads\//$PL_BRANCH_CHAR }${vcs_info_msg_0_%% }${mode}"
|
||||
|
||||
echo -n "${ref/refs\/heads\//$PL_BRANCH_CHAR }${vcs_info_msg_0_%% }${mode}"
|
||||
fi
|
||||
}
|
||||
|
||||
prompt_kubectl() {
|
||||
prompt_segment magenta blue
|
||||
echo -n ${ZSH_KUBECTL_PROMPT}
|
||||
}
|
||||
|
||||
prompt_bzr() {
|
||||
(( $+commands[bzr] )) || return
|
||||
|
||||
|
|
@ -262,6 +275,7 @@ build_prompt() {
|
|||
prompt_context
|
||||
prompt_dir
|
||||
prompt_git
|
||||
prompt_kubectl
|
||||
prompt_bzr
|
||||
prompt_hg
|
||||
prompt_end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue