53d8a316b0eb37cdfd6c405c19a5f52c46d7787d

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

Message

Various improvements to README

Diff

 1diff --git a/README.md b/README.md
 2index 4d0a25a3a039c6136d178808f883ba88f99b6046..eea14d4a8b30c6e4404568c4699b596d1e15b2c2 100644
 3--- a/README.md
 4+++ b/README.md
 5@@ -6,8 +6,12 @@ Autoswitch Python Virtualenv
 6 *zsh-autoswitch-virtualenv* is a simple ZSH plugin that switches python virtualenvs automatically as
 7 you move between directories.
 8 
 9-You do this by simply calling the `mkvenv` command in the directory you wish to setup a virtual
10-environment. After that command is completed, everything is setup and you are good to go! See the
11+
12+How it Works
13+============
14+
15+Simply call the `mkvenv` command in the directory you wish to setup a virtual environment.
16+After that command is completed, everything is setup and you are good to go! See the
17 *Commands* section below for more detail.
18 
19 Moving out of the directory will automatically deactivate the virtual environment. However you can
20@@ -58,9 +62,10 @@ zgen load MichaelAquilina/zsh-autoswitch-virtualenv
21 ```
22 
23 Commands
24---------
25+========
26 
27 Setup a new project with virtualenv autoswitching using the `mkvenv` helper command.
28+
29 ```
30 $ cd my-python-project
31 $ mkvenv
32@@ -74,10 +79,12 @@ Collecting requests (from -r requirements.txt (line 1))
33 Installing collected packages: requests
34 Successfully installed requests-2.11.1
35 ```
36+
37 `mkvenv` will create a virtual environment with the same name as the current directory, suggest
38 installing `requirements.txt` if available and create the relevant `.venv` file for you.
39 
40 Next time you switch to that folder, you'll see the following message
41+
42 ```
43 $ cd my-python-project
44 Switching virtualenv: my-python-project  [Python 3.4.3+]
45@@ -86,6 +93,7 @@ $
46 
47 If you have set the `AUTOSWITCH_DEFAULTENV` environment variable, exiting that directory will switch
48 back to the value set.
49+
50 ```
51 $ cd ..
52 Switching virtualenv: mydefaultenv  [Python 3.4.3+]
53@@ -97,14 +105,17 @@ python environment.
54 
55 You can remove the virtual environment for a directory you are currently in using the `rmvenv`
56 helper function:
57+
58 ```
59 $ cd my-python-project
60 $ rmvenv
61 Switching virtualenv: mydefaultenv  [Python 2.7.12]
62 Removing myproject...
63 ```
64+
65 This will delete the virtual environment in `.venv` and remove the `.venv` file itself. The `rmvenv`
66 command will fail if there is no `.venv` file in the current directory:
67+
68 ```
69 $ cd my-non-python-project
70 $ rmvenv
71@@ -112,7 +123,7 @@ No .venv file in the current directory!
72 ```
73 
74 Setting a default virtualenv
75-----------------------------
76+============================
77 
78 If you want to set a default virtual environment then you can also export `AUTOSWITCH_DEFAULTENV` in
79 your `.zshrc` file.
80@@ -123,7 +134,7 @@ antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
81 ```
82 
83 Options
84--------
85+=======
86 
87 Right now the only option available is to prevent verbose messages from being displayed when moving
88 between directories. You can do this by setting `AUTOSWITCH_SILENT` to a non-empty value.