2013-03-20 16:59:17 -07:00
|
|
|
prompt_pwd() {
|
2013-03-16 11:29:30 -07:00
|
|
|
SHORTPWD=`print -Pn "%4~"`
|
2013-07-27 21:17:25 -07:00
|
|
|
|
|
|
|
if [[ -n "${ZSH_VERSION:-}" ]]
|
|
|
|
then _pwd="${SHORTPWD[0,1]}"
|
|
|
|
else _pwd="${SHORTPWD:0:1}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
[[ $_pwd =~ "[^/~]" ]] && SHORTPWD=".../$SHORTPWD"
|
|
|
|
|
2013-03-20 16:55:09 -07:00
|
|
|
echo -n $SHORTPWD
|
|
|
|
}
|
2013-03-16 11:29:30 -07:00
|
|
|
|
2013-03-20 16:59:17 -07:00
|
|
|
prompt_git() {
|
2013-03-20 16:55:09 -07:00
|
|
|
if [ "`git_prompt_info`" ]; then
|
|
|
|
echo -n "$(git_prompt_info)"
|
|
|
|
fi
|
2013-03-16 11:29:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
# GIT Stuff
|
2013-03-20 16:55:09 -07:00
|
|
|
ZSH_THEME_GIT_PROMPT_PREFIX=" :%{$fg[white]%}"
|
2013-03-16 11:29:30 -07:00
|
|
|
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
|
|
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}+%{$fg[white]%}"
|
2013-03-20 16:55:09 -07:00
|
|
|
# ZSH_THEME_GIT_PROMPT_CLEAN=""
|
2013-03-16 11:29:30 -07:00
|
|
|
|
|
|
|
|
|
|
|
##################
|
|
|
|
# Build Prompt #
|
|
|
|
##################
|
|
|
|
|
2013-08-02 12:37:20 -07:00
|
|
|
prompt_vimode() {
|
2013-08-03 08:16:19 -07:00
|
|
|
MODE_INDICATOR=" %{$fg[green]%}\$ "
|
|
|
|
echo -n "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/ \$ }"
|
2013-08-02 12:37:20 -07:00
|
|
|
}
|
|
|
|
|
2013-03-20 16:55:09 -07:00
|
|
|
prompt() {
|
2013-07-27 20:11:52 -07:00
|
|
|
echo -n "%{$FG[242]%}"
|
2013-07-31 09:10:17 -07:00
|
|
|
echo -n '$(date "+%H:%M:%S")'
|
2013-07-27 20:11:52 -07:00
|
|
|
echo -n "%{$FG[white]%}"
|
2013-03-20 16:55:09 -07:00
|
|
|
|
|
|
|
# Show the hostname if this is an SSH session
|
|
|
|
if [[ -n $SSH_CLIENT ]]; then
|
2013-07-27 21:17:25 -07:00
|
|
|
echo -n "%{$fg[blue]%}"
|
|
|
|
echo -n " $(hostname)"
|
2013-03-20 16:55:09 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
# The prompt
|
2013-07-27 20:11:52 -07:00
|
|
|
echo -n "%{$fg[red]%}"
|
|
|
|
echo -n "%{$FX[bold]%}"
|
2013-08-02 12:37:20 -07:00
|
|
|
|
2013-08-03 08:16:19 -07:00
|
|
|
echo -n '$(prompt_vimode)'
|
|
|
|
# echo -n ' $ '
|
|
|
|
|
|
|
|
echo -n "%{$reset_color%}"
|
2013-03-20 16:55:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
rprompt() {
|
|
|
|
# Make the rprompt a bright grey to set it apart
|
|
|
|
echo -n "%{$FG[245]%}"
|
2013-03-20 16:59:17 -07:00
|
|
|
echo -n '$(prompt_pwd)'
|
2013-03-20 16:55:09 -07:00
|
|
|
|
|
|
|
# Show the branch/status if in a git repo
|
2013-03-20 16:59:17 -07:00
|
|
|
echo -n '$(prompt_git)'
|
2013-03-20 16:55:09 -07:00
|
|
|
|
|
|
|
# Reset formatting for command output
|
|
|
|
echo -n "%{$reset_color%}"
|
|
|
|
}
|
|
|
|
|
2013-08-02 13:23:37 -07:00
|
|
|
PROMPT="
|
|
|
|
$(prompt)"
|
2013-03-20 16:55:09 -07:00
|
|
|
RPROMPT="$(rprompt)"
|
2013-03-22 18:10:59 -07:00
|
|
|
|
|
|
|
# vim:set ft=zsh:
|