diff --git a/completion/available/conda.completion.bash b/completion/available/conda.completion.bash new file mode 100644 index 00000000..cb5a15da --- /dev/null +++ b/completion/available/conda.completion.bash @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +which register-python-argcomplete > /dev/null \ + && eval "$(register-python-argcomplete conda)" \ + || echo "Please install argcomplete to use conda completion" diff --git a/install.sh b/install.sh index 46edcf22..4c0bf081 100755 --- a/install.sh +++ b/install.sh @@ -36,7 +36,7 @@ function load_all() { [ ${filename:0:1} = "_" ] && continue dest="${BASH_IT}/${file_type}/enabled/${filename}" if [ ! -e "${dest}" ]; then - ln -s "${src}" "${dest}" + ln -s "../available/${filename}" "${dest}" else echo "File ${dest} exists, skipping" fi @@ -57,7 +57,7 @@ function load_some() { read -p "Would you like to enable the ${file_name%%.*} $file_type? [Y/N] " RESP case $RESP in [yY]) - ln -s "$path" "$BASH_IT/$file_type/enabled" + ln -s "../available/${file_name}" "$BASH_IT/$file_type/enabled" break ;; [nN]) diff --git a/lib/helpers.bash b/lib/helpers.bash index 941a876b..e273110f 100644 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -278,7 +278,7 @@ _enable-thing () do plugin=$(basename $f) if [ ! -h $BASH_IT/$subdirectory/enabled/$plugin ]; then - ln -s $BASH_IT/$subdirectory/available/$plugin $BASH_IT/$subdirectory/enabled/$plugin + ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin fi done else @@ -296,7 +296,7 @@ _enable-thing () mkdir -p $BASH_IT/$subdirectory/enabled - ln -s $BASH_IT/$subdirectory/available/$plugin $BASH_IT/$subdirectory/enabled/$plugin + ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin fi printf '%s\n' "$file_entity enabled." diff --git a/themes/powerline/powerline.theme.bash b/themes/powerline/powerline.theme.bash index 81598dec..012f9333 100644 --- a/themes/powerline/powerline.theme.bash +++ b/themes/powerline/powerline.theme.bash @@ -53,9 +53,16 @@ function powerline_shell_prompt { } function powerline_virtualenv_prompt { - if [[ -n "$VIRTUAL_ENV" ]]; then - virtualenv=$(basename "$VIRTUAL_ENV") - VIRTUALENV_PROMPT="$(set_rgb_color ${LAST_THEME_COLOR} ${VIRTUALENV_THEME_PROMPT_COLOR})${THEME_PROMPT_SEPARATOR}${normal}$(set_rgb_color - ${VIRTUALENV_THEME_PROMPT_COLOR}) ${VIRTUALENV_CHAR}$virtualenv ${normal}" + local environ="" + + if [[ -n "$CONDA_DEFAULT_ENV" ]]; then + environ="conda: $CONDA_DEFAULT_ENV" + elif [[ -n "$VIRTUAL_ENV" ]]; then + environ=$(basename "$VIRTUAL_ENV") + fi + + if [[ -n "$environ" ]]; then + VIRTUALENV_PROMPT="$(set_rgb_color ${LAST_THEME_COLOR} ${VIRTUALENV_THEME_PROMPT_COLOR})${THEME_PROMPT_SEPARATOR}${normal}$(set_rgb_color - ${VIRTUALENV_THEME_PROMPT_COLOR}) ${VIRTUALENV_CHAR}$environ ${normal}" LAST_THEME_COLOR=${VIRTUALENV_THEME_PROMPT_COLOR} else VIRTUALENV_PROMPT=""