Created
January 9, 2016 03:55
-
-
Save dm1try/c061f5ff7a6ff4d78cae to your computer and use it in GitHub Desktop.
custom theme for my oh-my-zsh. It displays `elixir`/`ruby` version in the prompt(dependent on current dir); requirements `rvm` for `ruby`, `kiex` for `elixir`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function elixir_version() { | |
if [ -f "$PWD/mix.exs" ]; then | |
echo "$ELIXIR_VERSION " | |
fi | |
} | |
function ruby_version() { | |
if [ -f "$PWD/Gemfile" ]; then | |
echo "${RUBY_VERSION#*-} " | |
fi | |
} | |
RUBY_PROMPT_="%{$FG[33]%}%{$FG[203]%}\$(ruby_version)%{$FG[33]%}%{$reset_color%}" | |
ELIXIR_PROMPT_="%{$FG[33]%}%{$FG[105]%}\$(elixir_version)%{$FG[33]%}%{$reset_color%}" | |
HOST_PROMPT_="%{$FG[123]%}%c " | |
GIT_PROMPT="\$(git_prompt_info) " | |
PROMPT="$HOST_PROMPT_$RUBY_PROMPT_$ELIXIR_PROMPT_$GIT_PROMPT" | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$FG[202]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$FG[196]%}*" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment