my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
980 B

3 years ago
  1. # Virtualenvwrapper plugin
  2. This plugin loads Python's [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/) shell tools.
  3. To use it, add `virtualenvwrapper` to the plugins array in your zshrc file:
  4. ```zsh
  5. plugins=(... virtualenvwrapper)
  6. ```
  7. ## Usage
  8. The plugin allows to automatically activate virtualenvs on cd into git repositories with a matching name:
  9. ```
  10. ➜ github $ cd ansible
  11. (ansible) ➜ ansible git:(devel) $ cd docs
  12. (ansible) ➜ docs git:(devel) $ cd ..
  13. (ansible) ➜ ansible git:(devel) $ cd ..
  14. ➜ github $
  15. ```
  16. We can override this by having a `.venv` file in the directory containing a differently named virtualenv:
  17. ```
  18. ➜ github $ cat ansible/.venv
  19. myvirtualenv
  20. ➜ github $ cd ansible
  21. (myvirtualenv) ➜ ansible git:(devel) $ cd ..
  22. ➜ github $
  23. ```
  24. We can disable this behaviour by setting `DISABLE_VENV_CD=1` before Oh My Zsh is sourced:
  25. ```zsh
  26. DISABLE_VENV_CD=1
  27. plugins=(... virtualenvwrapper)
  28. source $ZSH/oh-my-zsh.sh
  29. ```