Support for @sorin-ionescu rewrite of oh-my-zsh
Sorin's OMZ rewrite is a bit nicer, as it's written in more
native style ZSH, doesn't do auto updates, and incorporates
many bugfixes, and is more actively maintained than Robby's branch.
For now, YADR supports both, so if you want to try out the sorin
branch, go to sorin-ionescu/oh-my-zsh, install it, and rerun
the YADR installer so that the skwp theme is installed for you.
If you want to have them side by side for comparison, rename the
old robby one to ~/.oh-my-zsh.robby or similar, so you can toggle
back and forth through renames, or symlinks.
2012-04-24 01:32:10 +08:00
|
|
|
#
|
|
|
|
# A theme based on steeef theme
|
2012-10-24 01:11:27 +08:00
|
|
|
# * RVM/Rbenv info shown on the right
|
Support for @sorin-ionescu rewrite of oh-my-zsh
Sorin's OMZ rewrite is a bit nicer, as it's written in more
native style ZSH, doesn't do auto updates, and incorporates
many bugfixes, and is more actively maintained than Robby's branch.
For now, YADR supports both, so if you want to try out the sorin
branch, go to sorin-ionescu/oh-my-zsh, install it, and rerun
the YADR installer so that the skwp theme is installed for you.
If you want to have them side by side for comparison, rename the
old robby one to ~/.oh-my-zsh.robby or similar, so you can toggle
back and forth through renames, or symlinks.
2012-04-24 01:32:10 +08:00
|
|
|
# * Git branch info on the left
|
|
|
|
# * Single line prompt
|
|
|
|
#
|
|
|
|
# Authors:
|
|
|
|
# Steve Losh <steve@stevelosh.com>
|
|
|
|
# Bart Trojanowski <bart@jukie.net>
|
|
|
|
# Brian Carper <brian@carper.ca>
|
|
|
|
# steeef <steeef@gmail.com>
|
|
|
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
|
|
|
# Yan Pritzker <yan@pritzker.ws>
|
|
|
|
|
|
|
|
function prompt_skwp_precmd {
|
2012-11-07 01:16:58 +08:00
|
|
|
setopt LOCAL_OPTIONS
|
|
|
|
unsetopt XTRACE KSH_ARRAYS
|
|
|
|
|
|
|
|
# Get Git repository information.
|
2020-02-09 22:19:15 +08:00
|
|
|
if [[ $DISABLE_GIT_INFO == 1 ]]; then
|
|
|
|
git-info off
|
|
|
|
elif [[ $+functions[git-info] ]]; then
|
2012-11-16 23:34:00 +08:00
|
|
|
git-info on
|
2012-11-07 01:16:58 +08:00
|
|
|
git-info
|
Support for @sorin-ionescu rewrite of oh-my-zsh
Sorin's OMZ rewrite is a bit nicer, as it's written in more
native style ZSH, doesn't do auto updates, and incorporates
many bugfixes, and is more actively maintained than Robby's branch.
For now, YADR supports both, so if you want to try out the sorin
branch, go to sorin-ionescu/oh-my-zsh, install it, and rerun
the YADR installer so that the skwp theme is installed for you.
If you want to have them side by side for comparison, rename the
old robby one to ~/.oh-my-zsh.robby or similar, so you can toggle
back and forth through renames, or symlinks.
2012-04-24 01:32:10 +08:00
|
|
|
fi
|
|
|
|
|
2012-11-07 01:16:58 +08:00
|
|
|
# Get ruby information
|
|
|
|
if (( $+functions[ruby-info] )); then
|
|
|
|
ruby-info
|
|
|
|
fi
|
Support for @sorin-ionescu rewrite of oh-my-zsh
Sorin's OMZ rewrite is a bit nicer, as it's written in more
native style ZSH, doesn't do auto updates, and incorporates
many bugfixes, and is more actively maintained than Robby's branch.
For now, YADR supports both, so if you want to try out the sorin
branch, go to sorin-ionescu/oh-my-zsh, install it, and rerun
the YADR installer so that the skwp theme is installed for you.
If you want to have them side by side for comparison, rename the
old robby one to ~/.oh-my-zsh.robby or similar, so you can toggle
back and forth through renames, or symlinks.
2012-04-24 01:32:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
function prompt_skwp_setup {
|
|
|
|
setopt LOCAL_OPTIONS
|
|
|
|
unsetopt XTRACE KSH_ARRAYS
|
2019-04-10 18:50:16 +08:00
|
|
|
prompt_opts=(cr percent sp subst)
|
Support for @sorin-ionescu rewrite of oh-my-zsh
Sorin's OMZ rewrite is a bit nicer, as it's written in more
native style ZSH, doesn't do auto updates, and incorporates
many bugfixes, and is more actively maintained than Robby's branch.
For now, YADR supports both, so if you want to try out the sorin
branch, go to sorin-ionescu/oh-my-zsh, install it, and rerun
the YADR installer so that the skwp theme is installed for you.
If you want to have them side by side for comparison, rename the
old robby one to ~/.oh-my-zsh.robby or similar, so you can toggle
back and forth through renames, or symlinks.
2012-04-24 01:32:10 +08:00
|
|
|
|
|
|
|
autoload -Uz add-zsh-hook
|
|
|
|
|
|
|
|
add-zsh-hook precmd prompt_skwp_precmd
|
|
|
|
|
|
|
|
# Use extended color pallete if available.
|
|
|
|
if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
|
|
|
|
__PROMPT_SKWP_COLORS=(
|
|
|
|
"%F{81}" # turquoise
|
|
|
|
"%F{166}" # orange
|
|
|
|
"%F{135}" # purple
|
|
|
|
"%F{161}" # hotpink
|
|
|
|
"%F{118}" # limegreen
|
|
|
|
)
|
|
|
|
else
|
|
|
|
__PROMPT_SKWP_COLORS=(
|
|
|
|
"%F{cyan}"
|
|
|
|
"%F{yellow}"
|
|
|
|
"%F{magenta}"
|
|
|
|
"%F{red}"
|
|
|
|
"%F{green}"
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
|
2012-11-07 01:16:58 +08:00
|
|
|
# git
|
|
|
|
zstyle ':prezto:module:git:info:branch' format "${__PROMPT_SKWP_COLORS[1]}%b%f"
|
|
|
|
zstyle ':prezto:module:git:info:added' format "${__PROMPT_SKWP_COLORS[5]}●%f"
|
|
|
|
zstyle ':prezto:module:git:info:deleted' format "${__PROMPT_SKWP_COLORS[2]}●%f"
|
|
|
|
zstyle ':prezto:module:git:info:modified' format "${__PROMPT_SKWP_COLORS[4]}●%f"
|
2012-11-16 23:34:00 +08:00
|
|
|
zstyle ':prezto:module:git:info:untracked' format "${__PROMPT_SKWP_COLORS[3]}●%f"
|
2012-11-07 01:16:58 +08:00
|
|
|
zstyle ':prezto:module:git:info:keys' format 'prompt' '(%b%d%a%m%u)'
|
Support for @sorin-ionescu rewrite of oh-my-zsh
Sorin's OMZ rewrite is a bit nicer, as it's written in more
native style ZSH, doesn't do auto updates, and incorporates
many bugfixes, and is more actively maintained than Robby's branch.
For now, YADR supports both, so if you want to try out the sorin
branch, go to sorin-ionescu/oh-my-zsh, install it, and rerun
the YADR installer so that the skwp theme is installed for you.
If you want to have them side by side for comparison, rename the
old robby one to ~/.oh-my-zsh.robby or similar, so you can toggle
back and forth through renames, or symlinks.
2012-04-24 01:32:10 +08:00
|
|
|
|
2012-11-07 01:16:58 +08:00
|
|
|
# ruby info (rvm, rbenv)
|
|
|
|
zstyle ':prezto:module:ruby:info:version' format '[%v]'
|
Support for @sorin-ionescu rewrite of oh-my-zsh
Sorin's OMZ rewrite is a bit nicer, as it's written in more
native style ZSH, doesn't do auto updates, and incorporates
many bugfixes, and is more actively maintained than Robby's branch.
For now, YADR supports both, so if you want to try out the sorin
branch, go to sorin-ionescu/oh-my-zsh, install it, and rerun
the YADR installer so that the skwp theme is installed for you.
If you want to have them side by side for comparison, rename the
old robby one to ~/.oh-my-zsh.robby or similar, so you can toggle
back and forth through renames, or symlinks.
2012-04-24 01:32:10 +08:00
|
|
|
|
2017-08-09 16:44:44 +08:00
|
|
|
PROMPT="${__PROMPT_SKWP_COLORS[3]}%n%f ${__PROMPT_SKWP_COLORS[5]}%~%f "'$git_info[prompt]'"$ "
|
2019-09-20 17:51:19 +08:00
|
|
|
[[ $USING_PROXYCHAINS == 'true' ]] && PROMPT="🔗 $PROMPT"
|
2012-11-07 01:16:58 +08:00
|
|
|
RPROMPT='%F{blue}${ruby_info[version]}'
|
Support for @sorin-ionescu rewrite of oh-my-zsh
Sorin's OMZ rewrite is a bit nicer, as it's written in more
native style ZSH, doesn't do auto updates, and incorporates
many bugfixes, and is more actively maintained than Robby's branch.
For now, YADR supports both, so if you want to try out the sorin
branch, go to sorin-ionescu/oh-my-zsh, install it, and rerun
the YADR installer so that the skwp theme is installed for you.
If you want to have them side by side for comparison, rename the
old robby one to ~/.oh-my-zsh.robby or similar, so you can toggle
back and forth through renames, or symlinks.
2012-04-24 01:32:10 +08:00
|
|
|
}
|
|
|
|
|
2020-02-09 22:19:15 +08:00
|
|
|
alias disable_git_info='DISABLE_GIT_INFO=1'
|
|
|
|
alias enable_git_info='DISABLE_GIT_INFO=0'
|
Support for @sorin-ionescu rewrite of oh-my-zsh
Sorin's OMZ rewrite is a bit nicer, as it's written in more
native style ZSH, doesn't do auto updates, and incorporates
many bugfixes, and is more actively maintained than Robby's branch.
For now, YADR supports both, so if you want to try out the sorin
branch, go to sorin-ionescu/oh-my-zsh, install it, and rerun
the YADR installer so that the skwp theme is installed for you.
If you want to have them side by side for comparison, rename the
old robby one to ~/.oh-my-zsh.robby or similar, so you can toggle
back and forth through renames, or symlinks.
2012-04-24 01:32:10 +08:00
|
|
|
prompt_skwp_setup "$@"
|