mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
Moving all autoenv logic to the plugin file.
-Some of this was previously located in the directories lib. -Also unsetting the cd override function created by autoenv and replacing it with a zsh hook.
This commit is contained in:
parent
580bf9bb24
commit
e34c6f9fe1
2 changed files with 8 additions and 3 deletions
|
|
@ -30,9 +30,6 @@ cd () {
|
||||||
cd ../../../..
|
cd ../../../..
|
||||||
elif [[ "x$*" == "x......" ]]; then
|
elif [[ "x$*" == "x......" ]]; then
|
||||||
cd ../../../../..
|
cd ../../../../..
|
||||||
elif [ -d ~/.autoenv ]; then
|
|
||||||
source ~/.autoenv/activate.sh
|
|
||||||
autoenv_cd "$@"
|
|
||||||
else
|
else
|
||||||
builtin cd "$@"
|
builtin cd "$@"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,11 @@
|
||||||
|
# Add the functions from autoenv if it's installed.
|
||||||
|
if [ -r ~/.autoenv/activate.sh ]; then
|
||||||
|
source ~/.autoenv/activate.sh
|
||||||
|
# Use a zsh hook instead of overriding the builtin cd.
|
||||||
|
unset -f cd
|
||||||
|
add-zsh-hook chpwd autoenv_init
|
||||||
|
fi
|
||||||
|
|
||||||
# The use_env call below is a reusable command to activate/create a new Python
|
# The use_env call below is a reusable command to activate/create a new Python
|
||||||
# virtualenv, requiring only a single declarative line of code in your .env files.
|
# virtualenv, requiring only a single declarative line of code in your .env files.
|
||||||
# It only performs an action if the requested virtualenv is not the current one.
|
# It only performs an action if the requested virtualenv is not the current one.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue