From 84a379462f5ec3ac3b8c842686bc2a1b418f34ac Mon Sep 17 00:00:00 2001 From: Lev Givon Date: Wed, 31 Dec 2014 14:55:54 -0500 Subject: [PATCH 1/2] Add conda support. --- git-prompt.conf | 3 ++- git-prompt.sh | 14 +++++++++++++- index.txt | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) 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..032cf22 100644 --- a/index.txt +++ b/index.txt @@ -200,7 +200,7 @@ time consuming ops in postconfig which is executed only once. - Dan Bravender - Thomas Geffert - Tibor Simko - +- Lev Givon [bibliography] .References From c6e04c971cc17abbc51145b9b950b2e893b5d9ae Mon Sep 17 00:00:00 2001 From: Lev Givon Date: Mon, 13 Apr 2015 09:10:45 -0400 Subject: [PATCH 2/2] Tweak index.txt. --- index.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.txt b/index.txt index 032cf22..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