mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
Merge 63efab72ff into 79196f8213
This commit is contained in:
commit
5e18117153
3 changed files with 10 additions and 21 deletions
|
|
@ -21,23 +21,6 @@ alias 7='cd -7'
|
||||||
alias 8='cd -8'
|
alias 8='cd -8'
|
||||||
alias 9='cd -9'
|
alias 9='cd -9'
|
||||||
|
|
||||||
cd () {
|
|
||||||
if [[ "x$*" == "x..." ]]; then
|
|
||||||
cd ../..
|
|
||||||
elif [[ "x$*" == "x...." ]]; then
|
|
||||||
cd ../../..
|
|
||||||
elif [[ "x$*" == "x....." ]]; then
|
|
||||||
cd ../../../..
|
|
||||||
elif [[ "x$*" == "x......" ]]; then
|
|
||||||
cd ../../../../..
|
|
||||||
elif [ -d ~/.autoenv ]; then
|
|
||||||
source ~/.autoenv/activate.sh
|
|
||||||
autoenv_cd "$@"
|
|
||||||
else
|
|
||||||
builtin cd "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
alias md='mkdir -p'
|
alias md='mkdir -p'
|
||||||
alias rd=rmdir
|
alias rd=rmdir
|
||||||
alias d='dirs -v | head -10'
|
alias d='dirs -v | head -10'
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,8 @@ if [[ -f "$wrapsource" ]]; then
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# New cd function that does the virtualenv magic
|
# Add zsh hook for virtualenv magic
|
||||||
function cd {
|
add-zsh-hook chpwd workon_cwd
|
||||||
builtin cd "$@" && workon_cwd
|
|
||||||
}
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
print "zsh virtualenvwrapper plugin: Cannot find virtualenvwrapper_lazy.sh. Please install with \`pip install virtualenvwrapper\`."
|
print "zsh virtualenvwrapper plugin: Cannot find virtualenvwrapper_lazy.sh. Please install with \`pip install virtualenvwrapper\`."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue