Обновление ohmyzsh

This commit is contained in:
2021-06-10 11:49:35 +05:00
parent 9fcc978a55
commit e7247fa93a
501 changed files with 18233 additions and 8842 deletions

View File

@@ -1,13 +1,13 @@
# Pipenv completion
_pipenv() {
eval $(env COMMANDLINE="${words[1,$CURRENT]}" _PIPENV_COMPLETE=complete-zsh pipenv)
eval $(env COMMANDLINE="${words[1,$CURRENT]}" _PIPENV_COMPLETE=complete-zsh pipenv)
}
compdef _pipenv pipenv
# Automatic pipenv shell activation/deactivation
_togglePipenvShell() {
# deactivate shell if Pipfile doesn't exist and not in a subdir
if [[ ! -a "$PWD/Pipfile" ]]; then
if [[ ! -f "$PWD/Pipfile" ]]; then
if [[ "$PIPENV_ACTIVE" == 1 ]]; then
if [[ "$PWD" != "$pipfile_dir"* ]]; then
exit
@@ -17,13 +17,15 @@ _togglePipenvShell() {
# activate the shell if Pipfile exists
if [[ "$PIPENV_ACTIVE" != 1 ]]; then
if [[ -a "$PWD/Pipfile" ]]; then
if [[ -f "$PWD/Pipfile" ]]; then
export pipfile_dir="$PWD"
pipenv shell
fi
fi
}
chpwd_functions+=(_togglePipenvShell)
autoload -U add-zsh-hook
add-zsh-hook chpwd _togglePipenvShell
_togglePipenvShell
# Aliases
alias pch="pipenv check"