https://github.com/aperezdc/virtualz
Virtualfish-alike Python virtualenv wrapper for Zsh
https://github.com/aperezdc/virtualz
plugin python virtualenv zsh
Last synced: 8 months ago
JSON representation
Virtualfish-alike Python virtualenv wrapper for Zsh
- Host: GitHub
- URL: https://github.com/aperezdc/virtualz
- Owner: aperezdc
- Created: 2016-02-18T08:12:54.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-04-03T14:32:54.000Z (over 1 year ago)
- Last Synced: 2025-02-28T12:47:05.589Z (9 months ago)
- Topics: plugin, python, virtualenv, zsh
- Language: Shell
- Size: 27.3 KB
- Stars: 9
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-zsh-plugins - virtualz - Python [virtualenv](https://virtualenv.pypa.io/en/latest/) manager inspired by Adam Brenecki's [Virtualfish](https://github.com/adambrenecki/virtualfish) for the [Fish shell](http://fishshell.com/), replaces virtualenvwrapper. (Plugins / ZSH on Windows)
- fucking-awesome-zsh-plugins - virtualz - Python 🌎 [virtualenv](virtualenv.pypa.io/en/latest/) manager inspired by Adam Brenecki's <b><code> 1089⭐</code></b> <b><code> 103🍴</code></b> [Virtualfish](https://github.com/adambrenecki/virtualfish)) for the [Fish shell](http://fishshell.com/), replaces virtualenvwrapper. (Plugins / ZSH on Windows)
- awesome-zsh-plugins - virtualz - Python [virtualenv](https://virtualenv.pypa.io/en/latest/) manager inspired by Adam Brenecki's [Virtualfish](https://github.com/adambrenecki/virtualfish) for the [Fish shell](http://fishshell.com/), replaces virtualenvwrapper. (Plugins / Zinit (née zplugin))
README
# VirtualZ
A [Z shell](http://zsh.org) wrapper for Ian Bicking's
[virtualenv](https://virtualenv.pypa.io/en/latest/), loosely based on Adam
Brenecki's [virtualfish](https://github.com/adambrenecki/virtualfish) for the
[Fish shell](http://fishshell.com).
## Quickstart
Once installed, VirtualZ provides the `vz` command. Try the following:
```
vz new myvirtualenv
echo ${VIRTUAL_ENV}
which python
vz new othervirtualenv
echo ${VIRTUAL_ENV}
vz deactivate
vz rm myvirtualenv
vz rm othervirtualenv
```
### Additional Options
When creating a new environment, the additional parameters passed to the `vz
new` command are passed down to the `virtualenv` command. For example, this
can be used to specify which `python` executable to use:
```
vz new env-with-pypy -p /usr/bin/pypy
```
or to allow usage of packages installed system-wide:
```
vz new with-system-pkgs --system-site-packages
```
## Installation & Setup
The recommended way is to use a plugin manager. By default, the location where VirtualZ looks for virtualenvs is `~/.virtualenvs`. This can be changed by setting the desired path in the `${VIRTUALZ_HOME}` variable.
With [zgen](https://github.com/tarjoilija/zgen), add the following to your `.zshrc`:
```sh
zgen load aperezdc/virtualz
```
### Virtualenv name in the prompt
When a virtualenv is active, the following variables are defined:
- `VIRTUAL_ENV` contains the full path to the active environment.
- `VIRTUAL_ENV_NAME` contains the name of the active environment.
For example, the following will prepend the name of the current virtualenv to your existing prompt, but only if there's an environment active:
```sh
PROMPT='${VIRTUAL_ENV_NAME:+${VIRTUAL_ENV_NAME} }${PROMPT}'
```