diff options
| author | Thomas Schmucker <ts@its1.de> | 2026-01-13 10:53:26 +0100 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2026-01-13 10:53:26 +0100 |
| commit | cce88d21d475cef3b0f8377c042ad62438d1674b (patch) | |
| tree | 8a0bd6e1a2159f04f8543932d44aec7f3a784fc7 /zsh/zshrc | |
| parent | 719d9bdd3ad81f5e0ae381bae8c4b2b8b9b4da8e (diff) | |
| download | dotfiles-cce88d21d475cef3b0f8377c042ad62438d1674b.tar.gz dotfiles-cce88d21d475cef3b0f8377c042ad62438d1674b.tar.bz2 dotfiles-cce88d21d475cef3b0f8377c042ad62438d1674b.zip | |
zsh: Hook für Python-Umgebungen hinzugefügt.
Diffstat (limited to 'zsh/zshrc')
| -rw-r--r-- | zsh/zshrc | 17 |
1 files changed, 17 insertions, 0 deletions
| @@ -1,5 +1,22 @@ | |||
| 1 | # vim: filetype=zsh | 1 | # vim: filetype=zsh |
| 2 | 2 | ||
| 3 | # Hooks | ||
| 4 | function chpwd() { | ||
| 5 | if [[ -n "$VIRTUAL_ENV" ]]; then | ||
| 6 | local venv_dir="${VIRTUAL_ENV:h}" | ||
| 7 | if [[ "$PWD" != "$venv_dir"* ]]; then | ||
| 8 | deactivate | ||
| 9 | fi | ||
| 10 | fi | ||
| 11 | |||
| 12 | for v in .venv venv .env; do | ||
| 13 | if [[ -f "$v/bin/activate" ]]; then | ||
| 14 | source "$v/bin/activate" | ||
| 15 | break | ||
| 16 | fi | ||
| 17 | done | ||
| 18 | } | ||
| 19 | |||
| 3 | # Optionen | 20 | # Optionen |
| 4 | setopt AUTO_PARAM_SLASH | 21 | setopt AUTO_PARAM_SLASH |
| 5 | unsetopt CASE_GLOB | 22 | unsetopt CASE_GLOB |
