diff --git a/git-prompt.conf b/git-prompt.conf index dee3c0c..c969ca9 100644 --- a/git-prompt.conf +++ b/git-prompt.conf @@ -20,7 +20,7 @@ # hg_module=on # vim_module=on # virtualenv_module=on - +# conda_module=on ########################################################### DEFAULT OBJECTS ### Default objects are not displayed. Example: @@ -55,6 +55,7 @@ # dir_color=CYAN # rc_color=red # virtualenv_color=green + # conda_color=yellow # user_id_color=blue # root_id_color=magenta # else # B/W terminal diff --git a/git-prompt.sh b/git-prompt.sh index d1e88b3..ca5989b 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -34,6 +34,7 @@ hg_module=${hg_module:-on} vim_module=${vim_module:-on} virtualenv_module=${virtualenv_module:-on} + conda_module=${conda_module:-on} error_bell=${error_bell:-off} cwd_cmd=${cwd_cmd:-\\w} @@ -44,6 +45,7 @@ dir_color=${dir_color:-CYAN} rc_color=${rc_color:-red} virtualenv_color=${virtualenv_color:-green} + conda_color=${conda_color:-yellow} user_id_color=${user_id_color:-blue} root_id_color=${root_id_color:-magenta} else # only B/W @@ -290,6 +292,7 @@ set_shell_label() { dir_color=${!dir_color} rc_color=${!rc_color} virtualenv_color=${!virtualenv_color} + conda_color=${!conda_color} user_id_color=${!user_id_color} root_id_color=${!root_id_color} @@ -647,10 +650,18 @@ parse_virtualenv_status() { if [[ -n "$VIRTUAL_ENV" ]] ; then virtualenv=`basename $VIRTUAL_ENV` - rc="$rc $virtualenv_color<$virtualenv> " + rc="$rc$virtualenv_color<$virtualenv> " fi } +parse_conda_status() { + [[ $virtualenv_module = "on" ]] || return 1 + + if [[ -n "$CONDA_DEFAULT_ENV" ]] ; then + rc="$rc$conda_color[$CONDA_DEFAULT_ENV] " + fi +} + disable_set_shell_label() { trap - DEBUG >& /dev/null } @@ -702,6 +713,7 @@ prompt_command_function() { set_shell_label "${cwd##[/~]*/}/" # default label - path last dir parse_virtualenv_status + parse_conda_status parse_vcs_status # autojump diff --git a/index.txt b/index.txt index a48ab80..d26252c 100644 --- a/index.txt +++ b/index.txt @@ -47,6 +47,8 @@ GIT. Enable if needed in <> == Mercurial/HG HG module was developed by Lee Nussbaum ``. +== Conda +The Conda module was developed by Lev Givon ``. == Labels @@ -200,7 +202,7 @@ time consuming ops in postconfig which is executed only once. - Dan Bravender - Thomas Geffert - Tibor Simko - +- Lev Givon [bibliography] .References