ohmyzsh/plugins/viper-env
Daniel Kaminski de Souza a3567e84b0 Add viper-env plugin. 2021-02-01 22:05:37 +00:00
..
make_animation/assets Add viper-env plugin. 2021-02-01 22:05:37 +00:00
README.md Add viper-env plugin. 2021-02-01 22:05:37 +00:00
viper-env.plugin.zsh Add viper-env plugin. 2021-02-01 22:05:37 +00:00

README.md

Viper Env Z-Shel plugin

Automatically activates and deactivates python virtualenv upon cd in and out.

Inspiration

Based on blueray's answer, I decided to go one step further and implement it as a Z-Shell plugin.

Usage

Alt text

Example

> viper-env help

Description:
  Automatically activates and deactivates python virtualenv upon cd in and out.

Dependencies:
  - zsh
  - python

Example usage:
  # Create virtual environment
  python -m venv .venv
  # Save current dir
  current_dir=$(basename $PWD)
  # Exit current directory
  cd ..
  # Reenter it
  cd $current_dir

Instalation

Oh my Zsh

Git clone this repository to the Oh my Zsh custom plugins folder.

Add plugin to plugins directive in ~/.zshrc

plugins=(
  # put local oh-my-zsh plugins here
  viper-env
)

source $HOME/.oh-my-zsh/oh-my-zsh.sh

Antigen

It is recommended to use a .antigenrc file. Then add the following to it:

antigen bundle DanielAtKrypton/viper-env

# Apply changes
antigen apply

Make sure in your .zshrc Antigen is loading the .antigenrc file as follows:

antigen init ~/.antigenrc