Skip to content

Instantly share code, notes, and snippets.

@tadyjp
Created December 4, 2019 00:42
Show Gist options
  • Save tadyjp/1ac18fa9ea5b3b9096478ff4dcd91278 to your computer and use it in GitHub Desktop.
Save tadyjp/1ac18fa9ea5b3b9096478ff4dcd91278 to your computer and use it in GitHub Desktop.
zsh prompt
autoload -Uz vcs_info
setopt prompt_subst
zstyle ':vcs_info:git:*' check-for-changes true
zstyle ':vcs_info:git:*' stagedstr "!"
zstyle ':vcs_info:git:*' unstagedstr "+"
zstyle ':vcs_info:*' formats "%c%u:%b"
zstyle ':vcs_info:*' actionformats '%b:%a'
precmd() { vcs_info }
PROMPT_SEPARATOR=$'\u2b80'
KUBE_PS1_SYMBOL_ENABLE=false
KUBE_PS1_PREFIX='%K{027} '
KUBE_PS1_SUFFIX=" %k%F{027}${PROMPT_SEPARATOR}%f"
KUBE_PS1_CTX_COLOR='045'
KUBE_PS1_NS_COLOR='045'
PROMPT_STATUS='%(?.%K{039}.%K{196})%F{black}\$?=$?%f$k'
PROMPT_TIME='%K{202}%F{black} %* %K{214}%F{202}${PROMPT_SEPARATOR}'
PROMPT_DIR='%F{blue}$(pwd | sed -e "s,^$HOME,~," | perl -pe "s/~\/(src\/ghq|.go\/src)\/.+?\//ghq:/") %K{220}%F{214}${PROMPT_SEPARATOR}'
PROMPT_GIT='%F{blue}${vcs_info_msg_0_} %k%F{220}${PROMPT_SEPARATOR}%f'
PROMPT_K8S='$(kube_ps1)'
PROMPT_ENTRY='%F{190}$>%f'
PROMPT="${PROMPT_STATUS}
${PROMPT_TIME} ${PROMPT_DIR} ${PROMPT_GIT}
${PROMPT_K8S} ${PROMPT_ENTRY} "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment