Merge remote-tracking branch 'origin/master' into vadviktor-patch-pyenv

This commit is contained in:
Viktor (Icon) VAD
2015-09-24 10:06:55 +01:00
parent 3bfb593250
commit fbbd93f8a3
3 changed files with 55 additions and 39 deletions

View File

@@ -1,3 +1,4 @@
sudo: false
language: node_js language: node_js
node_js: node_js:
- 0.10 - 0.10

View File

@@ -13,7 +13,7 @@ simplicity, showing information only when it's relevant.
It currently shows: It currently shows:
- Current Python virtualenv; when using Pyenv and no active virtualenv shows the current Python version the shell uses - Current Python virtualenv; when using Pyenv and no active virtualenv shows the current Python version the shell uses
- Current Ruby version using Rbenv; version and gemset when on RVM - Current Ruby version using Rbenv or chruby; version and gemset when on RVM
- Current Node.js version, through NVM - Current Node.js version, through NVM
- Git status - Git status
- Timestamp - Timestamp
@@ -106,6 +106,7 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
|--------|-------|-------| |--------|-------|-------|
|`BULLETTRAIN_PROMPT_CHAR`|`\$`|Character to be show before any command |`BULLETTRAIN_PROMPT_CHAR`|`\$`|Character to be show before any command
|`BULLETTRAIN_PROMPT_ROOT`|`true`|Highlight if running as root |`BULLETTRAIN_PROMPT_ROOT`|`true`|Highlight if running as root
|`BULLETTRAIN_PROMPT_SEPARATE_LINE`|`true`|Make the prompt span across two lines
### Status ### Status
@@ -205,28 +206,32 @@ most of the code was later erased and its now more closely related to
of the project: of the project:
``` ```
82 Caio Gondim 100 Caio Gondim
33 Jérémy Romey 33 Jérémy Romey
07 Jocelyn Mallon 7 Jocelyn Mallon
06 Jérémy Romey 7 Greg Fitzgerald
06 Dan Kaplun 6 Dan Kaplun
05 Arthur Wang 6 Jérémy Romey
04 Flavius Aspra 6 Joe Block
04 Joe Block 5 Arthur Wang
02 wujtruj 4 Flavius Aspra
02 itsZero (Chien-An Cho) 3 Viktor (Icon) VAD
01 m.kuehn 3 Mario Zigliotto
01 Adrien Brault 2 wujtruj
01 yachi 2 itsZero (Chien-An Cho)
01 Guillaume BINET 1 yachi
01 Hannes Frank 1 Andreas Galauner
01 Kevin 1 Guillaume BINET
01 Mario Zigliotto 1 Hannes Frank
01 Marius Krämer 1 Kevin
01 Michael Robinson 1 Marius Krämer
01 gvillalta99 1 Michael Robinson
01 illuminatis 1 Sébastien Bordenave
01 krischer 1 gvillalta99
1 illuminatis
1 krischer
1 m.kuehn
1 Adrien Brault
``` ```
## Credits ## Credits

View File

@@ -22,6 +22,9 @@ fi
if [ ! -n "${BULLETTRAIN_PROMPT_ROOT+1}" ]; then if [ ! -n "${BULLETTRAIN_PROMPT_ROOT+1}" ]; then
BULLETTRAIN_PROMPT_ROOT=true BULLETTRAIN_PROMPT_ROOT=true
fi fi
if [ ! -n "${BULLETTRAIN_PROMPT_SEPARATE_LINE+1}" ]; then
BULLETTRAIN_PROMPT_SEPARATE_LINE=true
fi
# STATUS # STATUS
if [ ! -n "${BULLETTRAIN_STATUS_SHOW+1}" ]; then if [ ! -n "${BULLETTRAIN_STATUS_SHOW+1}" ]; then
@@ -257,7 +260,7 @@ prompt_context() {
# Git # Git
prompt_git() { prompt_git() {
if [[ $BULLETTRAIN_GIT_SHOW == false ]] then if [[ $BULLETTRAIN_GIT_SHOW == false ]]; then
return return
fi fi
@@ -267,7 +270,7 @@ prompt_git() {
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
prompt_segment $BULLETTRAIN_GIT_BG $BULLETTRAIN_GIT_FG prompt_segment $BULLETTRAIN_GIT_BG $BULLETTRAIN_GIT_FG
if [[ $BULLETTRAIN_GIT_EXTENDED == true ]] then if [[ $BULLETTRAIN_GIT_EXTENDED == true ]]; then
echo -n $(git_prompt_info)$(git_prompt_status) echo -n $(git_prompt_info)$(git_prompt_status)
else else
echo -n $(git_prompt_info) echo -n $(git_prompt_info)
@@ -312,7 +315,7 @@ prompt_hg() {
# Dir: current working directory # Dir: current working directory
prompt_dir() { prompt_dir() {
if [[ $BULLETTRAIN_DIR_SHOW == false ]] then if [[ $BULLETTRAIN_DIR_SHOW == false ]]; then
return return
fi fi
@@ -337,24 +340,27 @@ prompt_dir() {
# RUBY # RUBY
# RVM: only shows RUBY info if on a gemset that is not the default one # RVM: only shows RUBY info if on a gemset that is not the default one
# RBENV: shows current ruby version active in the shell # RBENV: shows current ruby version active in the shell
# CHRUBY: shows current ruby version active in the shell
prompt_ruby() { prompt_ruby() {
if [[ $BULLETTRAIN_RUBY_SHOW == false ]] then if [[ $BULLETTRAIN_RUBY_SHOW == false ]]; then
return return
fi fi
if which rvm-prompt &> /dev/null; then if command -v rvm-prompt > /dev/null 2>&1; then
if [[ ! -n $(rvm gemset list | grep "=> (default)") ]] if [[ ! -n $(rvm gemset list | grep "=> (default)") ]]
then then
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rvm-prompt i v g)" prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rvm-prompt i v g)"
fi fi
elif which rbenv &> /dev/null; then elif command -v chruby > /dev/null 2>&1; then
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(chruby | sed -e 's/ \* //')"
elif command -v rbenv > /dev/null 2>&1; then
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rbenv version | sed -e 's/ (set.*$//')" prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rbenv version | sed -e 's/ (set.*$//')"
fi fi
} }
# Virtualenv: current working virtualenv # Virtualenv: current working virtualenv
prompt_virtualenv() { prompt_virtualenv() {
if [[ $BULLETTRAIN_VIRTUALENV_SHOW == false ]] then if [[ $BULLETTRAIN_VIRTUALENV_SHOW == false ]]; then
return return
fi fi
@@ -368,7 +374,7 @@ prompt_virtualenv() {
# NVM: Node version manager # NVM: Node version manager
prompt_nvm() { prompt_nvm() {
if [[ $BULLETTRAIN_NVM_SHOW == false ]] then if [[ $BULLETTRAIN_NVM_SHOW == false ]]; then
return return
fi fi
@@ -382,11 +388,11 @@ prompt_nvm() {
} }
prompt_time() { prompt_time() {
if [[ $BULLETTRAIN_TIME_SHOW == false ]] then if [[ $BULLETTRAIN_TIME_SHOW == false ]]; then
return return
fi fi
if [[ $BULLETTRAIN_TIME_12HR == true ]] then if [[ $BULLETTRAIN_TIME_12HR == true ]]; then
prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG %D{%r} prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG %D{%r}
else else
prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG %D{%X} prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG %D{%X}
@@ -398,7 +404,7 @@ prompt_time() {
# - am I root # - am I root
# - are there background jobs? # - are there background jobs?
prompt_status() { prompt_status() {
if [[ $BULLETTRAIN_STATUS_SHOW == false ]] then if [[ $BULLETTRAIN_STATUS_SHOW == false ]]; then
return return
fi fi
@@ -409,9 +415,9 @@ prompt_status() {
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡%f" [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡%f"
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="⚙" [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="⚙"
if [[ -n "$symbols" && $RETVAL -ne 0 ]] then if [[ -n "$symbols" && $RETVAL -ne 0 ]]; then
prompt_segment $BULLETTRAIN_STATUS_ERROR_BG $BULLETTRAIN_STATUS_FG "$symbols" prompt_segment $BULLETTRAIN_STATUS_ERROR_BG $BULLETTRAIN_STATUS_FG "$symbols"
elif [[ -n "$symbols" ]] then elif [[ -n "$symbols" ]]; then
prompt_segment $BULLETTRAIN_STATUS_BG $BULLETTRAIN_STATUS_FG "$symbols" prompt_segment $BULLETTRAIN_STATUS_BG $BULLETTRAIN_STATUS_FG "$symbols"
fi fi
@@ -421,11 +427,11 @@ prompt_status() {
prompt_char() { prompt_char() {
local bt_prompt_char local bt_prompt_char
if [[ ${#BULLETTRAIN_PROMPT_CHAR} -eq 1 ]] then if [[ ${#BULLETTRAIN_PROMPT_CHAR} -eq 1 ]]; then
bt_prompt_char="${BULLETTRAIN_PROMPT_CHAR}" bt_prompt_char="${BULLETTRAIN_PROMPT_CHAR}"
fi fi
if [[ $BULLETTRAIN_PROMPT_ROOT == true ]] then if [[ $BULLETTRAIN_PROMPT_ROOT == true ]]; then
bt_prompt_char="%(!.%F{red}#.%F{green}${bt_prompt_char}%f)" bt_prompt_char="%(!.%F{red}#.%F{green}${bt_prompt_char}%f)"
fi fi
@@ -451,6 +457,10 @@ build_prompt() {
prompt_end prompt_end
} }
PROMPT=' if [[ $BULLETTRAIN_PROMPT_SEPARATE_LINE == true ]] then
PROMPT='
%{%f%b%k%}$(build_prompt) %{%f%b%k%}$(build_prompt)
%{${fg_bold[default]}%}$(prompt_char) %{$reset_color%}' %{${fg_bold[default]}%}$(prompt_char) %{$reset_color%}'
else
PROMPT='%{%f%b%k%}$(build_prompt)%{${fg_bold[default]}%} $(prompt_char) %{$reset_color%}'
fi