give-me-pipenv-zsh
Plugin for ZSH to source Python environments upon cd
-ing
I kept looking for one that worked well with my setup, but none of them worked when fuzzy-finding a folder using fzf
modified to use fd
.
Pipenv?
WhyBecause it makes it easier to manage virtual environments and dependencies for each project.
fzf
and fd
Why Because it be fast as frick boy.
Largely inspired by Anon-Guy-yapipenv.zsh, but
- checks for
Pipfile
in folder, if found:- but another venv is active, then switch over
- otherwise activate the specified venv
- sets
out
as an alias to deactivate the venv
Installation instructions
- make sure you have
pipenv
installed cd
into~/.oh-my-zsh/custom/plugin
andgit clone https://github.com/spramij/give-me-pipenv-zsh.git
- open
~/.zshrc
and addgive-me-pipenv-zsh
to your plugin list- might be different if you're not using oh-my-zsh !
Extras
- install
pipes
on your system - install
fzf
andfd
- activate the
fzf
plugin for ZSH (just add it to the list of plugins in.zshrc
) - add the following to
zshrc
:export FZF_DEFAULT_COMMAND="fd --type f --color always " export FZF_DEFAULT_OPTS='--ansi --border' export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_ALT_C_COMMAND="fd --type d"
- the plugin is compatible with
VSCode
, andpipes
: runpipes
to view all current Pipenv environments, select one and you'll teleport to it. Afterwards, pressCtrl+D
to exit the venv, orcd
into a project where you know another Pipenv is setup, and it'll switch over