5efe52d991ab1f2596c3aa7766c981412c621fd7

Author
Michael C <rm.cuffaro@gmail.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

virtualenvwrapper: add README (#8226)

Diff

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