Skip to content

lxp731/auto-venv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

A plugin for zsh to auto activate virtual environment. Applicable to uv, poetry. It will check current path if exist .venvor venv folder. Determine whether to activate the virtual environment based on this folder.

Installation

  1. For oh-my-zsh:
git clone https://github.com/lxp731/auto-venv.git "$ZSH_CUSTOM/plugins/auto-venv"

Then add this line to your .zshrc. Make sure it is before the line source $ZSH/oh-my-zsh.sh.

plugins=(
    ...
    auto-venv
)
  1. For bash:
wget https://raw.githubusercontent.com/lxp731/auto-venv/refs/heads/main/auto-venv.bash -O ~/.auto-venv.bash

Then add this line to your .bashrc, and source it.

echo "" >> ~/.bashrc && \
echo "### auto-activate python virtual environment" >> ~/.bashrc && \
echo "source ~/.auto-venv.bash" >> ~/.bashrc && \
source ~/.bashrc

About

Auto activate python virtual environment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages