Skip to content

Instantly share code, notes, and snippets.

View MDRushin's full-sized avatar

Matt Rushin MDRushin

  • Minnesota, USA
View GitHub Profile
@MDRushin
MDRushin / auto_python_venv.sh
Last active October 25, 2025 13:57 — forked from mikeckennedy/auto_python_venv.sh
Auto-activate Python virtual environment for any project with a venv directory in your shell (macOS/Linux).
# Include this in your shell *rc file (e.g. .bashrc, .zshrc, etc).
# Update the folder name to your convention.
# This uses venv as the virtual environment name, but if you use .venv, change it in the script.
# Auto-activate virtual environment for any project with a venv directory
function chpwd() {
# Function to find venv directory in current path or parent directories
local find_venv() {
local dir="$PWD"