mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-10-16 11:40:46 +00:00
Compare commits
6 commits
2d1a53150d
...
b9b26e4799
Author | SHA1 | Date | |
---|---|---|---|
|
b9b26e4799 | ||
|
367e9381df | ||
|
ba7a5e68e6 | ||
|
a6465f839f | ||
|
2422635513 | ||
|
e501f8aace |
2 changed files with 14 additions and 1 deletions
|
@ -163,7 +163,7 @@ function git_current_branch() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Outputs the name of the previously checked out branch
|
# Outputs the name of the previously checked out branch
|
||||||
# Usage example: git pull origin $(git_current_branch)
|
# Usage example: git pull origin $(git_previous_branch)
|
||||||
# rev-parse --symbolic-full-name @{-1} only prints if it is a branch
|
# rev-parse --symbolic-full-name @{-1} only prints if it is a branch
|
||||||
function git_previous_branch() {
|
function git_previous_branch() {
|
||||||
local ref
|
local ref
|
||||||
|
|
|
@ -227,6 +227,18 @@ prompt_virtualenv() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Anaconda: current working conda env
|
||||||
|
# To replace the conda modification of PS1 do `conda config --set changeps1 False`
|
||||||
|
# or add 'changeps1: False' to your .condarc file.
|
||||||
|
prompt_conda() {
|
||||||
|
local conda_env="$CONDA_DEFAULT_ENV"
|
||||||
|
if [[ -n $conda_env ]]; then
|
||||||
|
if [[ -z $CONDA_PROMPT_MODIFIER ]]; then
|
||||||
|
prompt_segment blue black "conda:$(basename $conda_env)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Status:
|
# Status:
|
||||||
# - was there an error
|
# - was there an error
|
||||||
# - am I root
|
# - am I root
|
||||||
|
@ -258,6 +270,7 @@ prompt_aws() {
|
||||||
build_prompt() {
|
build_prompt() {
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
prompt_status
|
prompt_status
|
||||||
|
prompt_conda
|
||||||
prompt_virtualenv
|
prompt_virtualenv
|
||||||
prompt_aws
|
prompt_aws
|
||||||
prompt_context
|
prompt_context
|
||||||
|
|
Loading…
Reference in a new issue