diff options
author | rmad17 <souravbasu17@gmail.com> | 2016-02-26 13:02:22 +0300 |
---|---|---|
committer | rmad17 <souravbasu17@gmail.com> | 2016-02-26 13:02:22 +0300 |
commit | e0603314d5b2b3cbb9ca5f75a990af813cc40ae1 (patch) | |
tree | 11bcf32c4d2a6f724aa466bcc5d493eaf42b3d4e /powerlevel9k.zsh-theme | |
parent | d5ac1735daac1d3b9d6b4d965f744e03f248b0d8 (diff) |
Nodeenv work
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index f8e75b33..94059c14 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -556,6 +556,23 @@ prompt_nvm() { $1_prompt_segment "$0" "$2" "green" "011" "${node_version:1}" 'NODE_ICON' } +# NodeEnv Prompt +prompt_nodeenv(){ + export NODE_VIRTUAL_ENV_DISABLE_PROMPT=1 + ZSH_THEME_NODEENV_PROMPT_PREFIX="(" + ZSH_THEME_NODEENV_PROMPT_SUFFIX=")" + if [ -n "$NODE_VIRTUAL_ENV" ]; then + + if [ "`basename "$NODE_VIRTUAL_ENV"`" = "__" ] ; then + # special case for Aspen magic directories + # see http://www.zetadev.com/software/aspen/ + local name="[`basename \`dirname "$NODE_VIRTUAL_ENV"\``]" + else + local name=`basename "$NODE_VIRTUAL_ENV"` + fi + echo "$ZSH_THEME_NODEENV_PROMPT_PREFIX$name$ZSH_THEME_NODEENV_PROMPT_SUFFIX" + fi +} # print a little OS icon prompt_os_icon() { |