mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-23 02:35:38 +01:00
➕ Add viper-env plugin.
This commit is contained in:
parent
f8022980a3
commit
0a19871e6f
8 changed files with 1714 additions and 0 deletions
66
plugins/viper-env/README.md
Normal file
66
plugins/viper-env/README.md
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
# Viper Env Z-Shel plugin
|
||||
|
||||
Automatically activates and deactivates python virtualenv upon cd in and out.
|
||||
|
||||
## Inspiration
|
||||
|
||||
Based on [blueray](https://stackoverflow.com/users/1772898/blueray)'s [answer](https://stackoverflow.com/a/63955939/11685534), I decided to go one step further and implement it as a Z-Shell plugin.
|
||||
|
||||
## Usage
|
||||
<!-- [](https://asciinema.org/a/4iMwcKfBS1dc1EgI1FihrDVxT) -->
|
||||
|
||||

|
||||
|
||||
## Example
|
||||
```zsh
|
||||
> viper-env help
|
||||
|
||||
Description:
|
||||
Automatically activates and deactivates python virtualenv upon cd in and out.
|
||||
|
||||
Dependencies:
|
||||
- zsh
|
||||
- python
|
||||
- `brew install coreutils` (macOS only)
|
||||
|
||||
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`
|
||||
```zsh
|
||||
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:
|
||||
|
||||
```zsh
|
||||
antigen bundle DanielAtKrypton/viper-env
|
||||
|
||||
# Apply changes
|
||||
antigen apply
|
||||
```
|
||||
|
||||
Make sure in your `.zshrc` Antigen is loading the `.antigenrc` file as follows:
|
||||
```zsh
|
||||
antigen init ~/.antigenrc
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue