You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zsh/prompt

45 lines
1.5 KiB

#if [ -f $HOME/.zsh/color ]
#then
# source $HOME/.zsh/color
#else
# COLOR_USER=white
# COLOR_HOST=white
# COLOR_PWD=white
# COLOR_VCS=white
#fi
# GIT Prompt
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
zstyle ':vcs_info:git:*' formats '[%b]'
### Old prompt format; [21:32][user@host][~/storage/git][git-branch]% [ar5]
if [ "$PROMPT_STYLE" = "ar5" ]
then
PROMPT="[%D{%H:%M}]%B%{$fg[$COLOR_USER]%}[%n@%m]%b%{$fg[$COLOR_PWD]%}[%~]%{$fg[$COLOR_VCS]%}%B\$vcs_info_msg_0_%b%{$fg[$COLOR_PWD]%}%# %{$reset_color%}"
fi
### BSD style prompt; user@host:~/storage/git[git-branch]% [bsd]
if [ "$PROMPT_STYLE" = "bsd" ]
then
PROMPT="%B%{$fg[$COLOR_USER]%}%n@%m%b%{$reset_color%}:%{$fg[$COLOR_PWD]%}%~%{$fg[$COLOR_VCS]%}%B \$vcs_info_msg_0_%b%{$fg[$COLOR_PWD]%}%# %{$reset_color%}"
fi
### BSD style prompt with more colours [bsd2]
if [ "$PROMPT_STYLE" = "bsd2" ]
then
PROMPT="%B%{$fg[$COLOR_USER]%}%n%{$reset_color%}%{$fg[white]%}@%B%{$fg[$COLOR_HOST]%}%m%b%{$reset_color%}:%{$fg[$COLOR_PWD]%}%~%{$fg[$COLOR_VCS]%}%B \$vcs_info_msg_0_%b%{$fg[$COLOR_PWD]%}%# %{$reset_color%}"
fi
### UNUSED ### New style with primary-coloured %/#
#PROMPT="%B%{$fg[$COLOR_USER]%}%n@%m%b%{$reset_color%}:%{$fg[$COLOR_PWD]%}%~%{$fg[$COLOR_VCS]%}%B\$vcs_info_msg_0_%b%{$fg[$COLOR_PWD]%}%B%{$fg[$COLOR]%}%# %{$reset_color%}"
# Print previous exit code only if exit code was non-zero
if [ "$SHOW_NZ_EXIT" = "true" ]
then
PROMPT="%(?..%?:)${PROMPT}"
fi