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