From c22f6e03af6135e26f6c139357bf98bf970bb140 Mon Sep 17 00:00:00 2001 From: "Viktor (Icon) VAD" Date: Sun, 4 Dec 2016 10:30:22 +0000 Subject: [PATCH 1/5] Adding basic Elixir prompt support --- bullet-train.zsh-theme | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/bullet-train.zsh-theme b/bullet-train.zsh-theme index 783b7bd..94ff808 100644 --- a/bullet-train.zsh-theme +++ b/bullet-train.zsh-theme @@ -28,6 +28,7 @@ if [ ! -n "${BULLETTRAIN_PROMPT_ORDER+1}" ]; then virtualenv nvm go + elixir git hg cmd_exec_time @@ -120,7 +121,7 @@ if [ ! -n "${BULLETTRAIN_RUBY_SHOW+1}" ]; then BULLETTRAIN_RUBY_SHOW=true fi if [ ! -n "${BULLETTRAIN_RUBY_BG+1}" ]; then - BULLETTRAIN_RUBY_BG=magenta + BULLETTRAIN_RUBY_BG=red fi if [ ! -n "${BULLETTRAIN_RUBY_FG+1}" ]; then BULLETTRAIN_RUBY_FG=white @@ -143,6 +144,20 @@ if [ ! -n "${BULLETTRAIN_GO_PREFIX+1}" ]; then BULLETTRAIN_GO_PREFIX="go " fi +# ELIXIR +if [ ! -n "${BULLETTRAIN_ELIXIR_SHOW+1}" ]; then + BULLETTRAIN_ELIXIR_SHOW=false +fi +if [ ! -n "${BULLETTRAIN_ELIXIR_BG+1}" ]; then + BULLETTRAIN_ELIXIR_BG=purple +fi +if [ ! -n "${BULLETTRAIN_ELIXIR_FG+1}" ]; then + BULLETTRAIN_ELIXIR_FG=white +fi +if [ ! -n "${BULLETTRAIN_ELIXIR_PREFIX+1}" ]; then + BULLETTRAIN_ELIXIR_PREFIX="💧" +fi + # DIR if [ ! -n "${BULLETTRAIN_DIR_SHOW+1}" ]; then BULLETTRAIN_DIR_SHOW=true @@ -512,6 +527,17 @@ prompt_ruby() { fi } +# ELIXIR +prompt_elixir() { + if [[ $BULLETTRAIN_ELIXIR_SHOW == false ]]; then + return + fi + + if command -v elixir > /dev/null 2>&1; then + prompt_segment $BULLETTRAIN_ELIXIR_BG $BULLETTRAIN_ELIXIR_FG $BULLETTRAIN_ELIXIR_PREFIX" $(elixir -v | tail -n 1 | awk '{print $2}')" + fi +} + # PERL # PLENV: shows current PERL version active in the shell prompt_perl() { From 58d80de14d0801a7f80d2211019535cf006c27f5 Mon Sep 17 00:00:00 2001 From: "Viktor (Icon) VAD" Date: Sun, 4 Dec 2016 10:39:45 +0000 Subject: [PATCH 2/5] Adding README update --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d18780..15eb045 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ It currently shows: - Current Ruby version using chruby; version and gemset when on RVM or Rbenv - Current Node.js version, through NVM (if present) or Node.js - Current Perl version using plenv +- Current Elixir version - Git status - Timestamp - Current directory @@ -172,10 +173,19 @@ NOTE: You do not need to specify *end* segment - it will be added automatically. |Variable|Default|Meaning |--------|-------|-------| |`BULLETTRAIN_RUBY_SHOW`|`true`|Show/hide that segment -|`BULLETTRAIN_RUBY_BG`|`magenta`|Background color +|`BULLETTRAIN_RUBY_BG`|`red`|Background color |`BULLETTRAIN_RUBY_FG`|`white`|Foreground color |`BULLETTRAIN_RUBY_PREFIX`|`"♦"`|Prefix of the segment +### Elixir + +|Variable|Default|Meaning +|--------|-------|-------| +|`BULLETTRAIN_ELIXIR_SHOW`|`true`|Show/hide that segment +|`BULLETTRAIN_ELIXIR_BG`|`magenta`|Background color +|`BULLETTRAIN_ELIXIR_FG`|`white`|Foreground color +|`BULLETTRAIN_ELIXIR_PREFIX`|`"💧"`|Prefix of the segment + ### Go |Variable|Default|Meaning From 2bc4979b67fa3c9c89873518a18189c6beb453a0 Mon Sep 17 00:00:00 2001 From: "Viktor (Icon) VAD" Date: Sun, 4 Dec 2016 11:50:11 +0000 Subject: [PATCH 3/5] typo of colour --- bullet-train.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bullet-train.zsh-theme b/bullet-train.zsh-theme index 94ff808..51fc74b 100644 --- a/bullet-train.zsh-theme +++ b/bullet-train.zsh-theme @@ -149,7 +149,7 @@ if [ ! -n "${BULLETTRAIN_ELIXIR_SHOW+1}" ]; then BULLETTRAIN_ELIXIR_SHOW=false fi if [ ! -n "${BULLETTRAIN_ELIXIR_BG+1}" ]; then - BULLETTRAIN_ELIXIR_BG=purple + BULLETTRAIN_ELIXIR_BG=magenta fi if [ ! -n "${BULLETTRAIN_ELIXIR_FG+1}" ]; then BULLETTRAIN_ELIXIR_FG=white From c6692a9bcd457d479f7878af435bd35ccdb2102f Mon Sep 17 00:00:00 2001 From: "Viktor (Icon) VAD" Date: Sun, 15 Jan 2017 08:23:32 +0000 Subject: [PATCH 4/5] removing deprecated "show" config --- bullet-train.zsh-theme | 7 ------- 1 file changed, 7 deletions(-) diff --git a/bullet-train.zsh-theme b/bullet-train.zsh-theme index 3cc8605..1c31ec0 100644 --- a/bullet-train.zsh-theme +++ b/bullet-train.zsh-theme @@ -127,9 +127,6 @@ if [ ! -n "${BULLETTRAIN_GO_PREFIX+1}" ]; then fi # ELIXIR -if [ ! -n "${BULLETTRAIN_ELIXIR_SHOW+1}" ]; then - BULLETTRAIN_ELIXIR_SHOW=false -fi if [ ! -n "${BULLETTRAIN_ELIXIR_BG+1}" ]; then BULLETTRAIN_ELIXIR_BG=magenta fi @@ -470,10 +467,6 @@ prompt_ruby() { # ELIXIR prompt_elixir() { - if [[ $BULLETTRAIN_ELIXIR_SHOW == false ]]; then - return - fi - if command -v elixir > /dev/null 2>&1; then prompt_segment $BULLETTRAIN_ELIXIR_BG $BULLETTRAIN_ELIXIR_FG $BULLETTRAIN_ELIXIR_PREFIX" $(elixir -v | tail -n 1 | awk '{print $2}')" fi From d255afbeb69b82de9756251fb24246fa1dffbd6c Mon Sep 17 00:00:00 2001 From: "Viktor (Icon) VAD" Date: Sun, 15 Jan 2017 18:46:06 +0000 Subject: [PATCH 5/5] updating readme of the removed variable --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 41af738..36d82c9 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,6 @@ NOTE: You do not need to specify *end* segment - it will be added automatically. |Variable|Default|Meaning |--------|-------|-------| -|`BULLETTRAIN_ELIXIR_SHOW`|`true`|Show/hide that segment |`BULLETTRAIN_ELIXIR_BG`|`magenta`|Background color |`BULLETTRAIN_ELIXIR_FG`|`white`|Foreground color |`BULLETTRAIN_ELIXIR_PREFIX`|`"💧"`|Prefix of the segment