title: How to automatically activate virtualenvs when cd'ing into a directory
body: <p>I have a bunch of projects in my <code>~/Documents</code>. I work almost exclusively in python, so these are basically all python projects. Each one, e.g. <code>~/Documents/foo</code> has its own virtualenv, <code>~/Documents/foo/venv</code> (they're always called venv). Whenever I switch between projects, which is ~10 times a day, I do </p>
  
  <pre><code>deactivate
  cd ..
  cd foo
  source venv/bin/activate
  </code></pre>
  
  <p>I've reached the point where I'm sick of typing <code>deactivate</code> and <code>source venv/bin/activate</code>. <strong>I'm looking for a way to just <code>cd ../foo</code> and have the virtualenv operations handled for me.</strong></p>
  
  <ul>
  <li><p>I'm familiar with <a href="https://virtualenvwrapper.readthedocs.io/en/latest/" rel="noreferrer">VirtualEnvWrapper</a> which is a little heavy-handed in my opinion. It seems to move all your virtualenvs somewhere else, and adds a little more complexity than it removes, as far as I can tell. (Dissenting opinions welcome!)</p></li>
  <li><p>I am not too familiar with shell scripting. If you can recommend a low-maintenance script to add to my <code>~/.zshrc</code> that accomplishes this, that would be more than enough, but from some quick googling, I haven't found such a script. </p></li>
  <li><p>I'm a <code>zsh</code>/<a href="https://github.com/robbyrussell/oh-my-zsh" rel="noreferrer"><code>oh-my-zsh</code></a> user. <code>oh-my-zsh</code> doesn't seem to have a plugin for this. The best answer to this question would be someone contributing an <code>oh-my-zsh</code> plugin which does this. (Which I might do if the answers here are lackluster. </p></li>
  </ul>