924cbb84a28a7044058331bb4fccf12ea47fb1da

Author
Michael Aquilina <michaelaquilina@gmail.com>
Committer
Michael Aquilina <michaelaquilina@gmail.com>
Date

Message

Update README with installation and Example section

Diff

 1diff --git a/README.md b/README.md
 2index a385b9c87c2750a7fdac222e0e475cb3a826d7ec..f66248ef7c24488d4ff8cd44df8d8460a264ab45 100644
 3--- a/README.md
 4+++ b/README.md
 5@@ -11,6 +11,45 @@ deactivate any currently active virtualenv.
 6 
 7 NOTE that the virutalenv you specify in `.venv` must already exist.
 8 
 9+Installation from Antigen
10+-------------------------
11+
12+Installing from Antigen is super easy! Just add the following line to your `.zshrc`:
13+
14+```
15+antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
16+```
17+if you want to set a default virtual environment then you can also export `DEFAULT_VIRTUALENV` in
18+your `.zshrc` file.
19+
20+```
21+export DEFAULT_VIRTUALENV="mydefaultenv"
22+antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
23+```
24+
25+Example:
26+--------
27+
28+Setup a new project with virtualenv autoswitching
29+```
30+$ cd my-python-project
31+$ mkvirtualenv my-python-project
32+$ echo "my-python-project" > .venv
33+```
34+Next time you switch to that folder, you'll see the following message
35+```
36+$ cd my-python-project
37+Switching virtualenv: my-python-project  [Python 3.4.3+]
38+```
39+If you have set the `DEFAULT_VIRTUALENV` environment variable, exiting that directory will switch
40+back to the value set.
41+```
42+$ cd ..
43+Switching virtualenv: default3  [Python 3.4.3+]
44+```
45+Otherwise, `deactivate` will simply be called on the virtualenv to switch back to the global
46+python environment.
47+
48 Requirements
49 ------------
50