mirror of
https://github.com/Cornelicorn/bullet-train.zsh.git
synced 2025-12-06 03:40:41 +01:00
Added plenv (PERL) segment
* Added BULLETTRAIN_PERL_ shell variable checks to bullet-train.zsh-theme * Added prompt_perl function
This commit is contained in:
10
README.md
10
README.md
@@ -11,6 +11,7 @@ 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 or chruby; 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
|
||||||
|
- Current Perl version using plenv
|
||||||
- Git status
|
- Git status
|
||||||
- Timestamp
|
- Timestamp
|
||||||
- Current directory
|
- Current directory
|
||||||
@@ -179,6 +180,15 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
|
|||||||
|`BULLETTRAIN_GO_FG`|`white`|Foreground color
|
|`BULLETTRAIN_GO_FG`|`white`|Foreground color
|
||||||
|`BULLETTRAIN_GO_PREFIX`|`go`|Prefix of the segment
|
|`BULLETTRAIN_GO_PREFIX`|`go`|Prefix of the segment
|
||||||
|
|
||||||
|
### Perl
|
||||||
|
|
||||||
|
|Variable|Default|Meaning
|
||||||
|
|--------|-------|-------|
|
||||||
|
|`BULLETTRAIN_PERL_SHOW`|`false`|Show/hide that segment
|
||||||
|
|`BULLETTRAIN_PERL_BG`|`yellow`|Background color
|
||||||
|
|`BULLETTRAIN_PERL_FG`|`black`|Foreground color
|
||||||
|
|`BULLETTRAIN_PERL_PREFIX`|`🐪`|Prefix of the segment
|
||||||
|
|
||||||
### Dir
|
### Dir
|
||||||
|
|
||||||
|Variable|Default|Meaning
|
|Variable|Default|Meaning
|
||||||
|
|||||||
@@ -164,6 +164,20 @@ if [ ! -n "${BULLETTRAIN_GIT_PROMPT_CMD+1}" ]; then
|
|||||||
BULLETTRAIN_GIT_PROMPT_CMD="\$(git_prompt_info)"
|
BULLETTRAIN_GIT_PROMPT_CMD="\$(git_prompt_info)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# PERL
|
||||||
|
if [ ! -n "${BULLETTRAIN_PERL_SHOW+1}" ]; then
|
||||||
|
BULLETTRAIN_PERL_SHOW=false
|
||||||
|
fi
|
||||||
|
if [ ! -n "${BULLETTRAIN_PERL_BG+1}" ]; then
|
||||||
|
BULLETTRAIN_PERL_BG=yellow
|
||||||
|
fi
|
||||||
|
if [ ! -n "${BULLETTRAIN_PERL_FG+1}" ]; then
|
||||||
|
BULLETTRAIN_PERL_FG=black
|
||||||
|
fi
|
||||||
|
if [ ! -n "${BULLETTRAIN_PERL_PREFIX+1}" ]; then
|
||||||
|
BULLETTRAIN_PERL_PREFIX=🐪
|
||||||
|
fi
|
||||||
|
|
||||||
# HG
|
# HG
|
||||||
if [ ! -n "${BULLETTRAIN_HG_SHOW+1}" ]; then
|
if [ ! -n "${BULLETTRAIN_HG_SHOW+1}" ]; then
|
||||||
BULLETTRAIN_HG_SHOW=true
|
BULLETTRAIN_HG_SHOW=true
|
||||||
@@ -448,6 +462,18 @@ prompt_ruby() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# PERL
|
||||||
|
# PLENV: shows current PERL version active in the shell
|
||||||
|
prompt_perl() {
|
||||||
|
if [[ $BULLETTRAIN_PERL_SHOW == false ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v plenv > /dev/null 2>&1; then
|
||||||
|
prompt_segment $BULLETTRAIN_PERL_BG $BULLETTRAIN_PERL_FG $BULLETTRAIN_PERL_PREFIX" $(plenv version | sed -e 's/ (set.*$//')"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Go
|
# Go
|
||||||
prompt_go() {
|
prompt_go() {
|
||||||
if [[ $BULLETTRAIN_GO_SHOW == false ]]; then
|
if [[ $BULLETTRAIN_GO_SHOW == false ]]; then
|
||||||
@@ -567,6 +593,7 @@ build_prompt() {
|
|||||||
prompt_custom
|
prompt_custom
|
||||||
prompt_context
|
prompt_context
|
||||||
prompt_dir
|
prompt_dir
|
||||||
|
prompt_perl
|
||||||
prompt_ruby
|
prompt_ruby
|
||||||
prompt_virtualenv
|
prompt_virtualenv
|
||||||
prompt_nvm
|
prompt_nvm
|
||||||
|
|||||||
Reference in New Issue
Block a user