Refactor xonsh config

This commit is contained in:
2022-01-06 16:50:56 -08:00
parent 33372e8300
commit 68d903d628
9 changed files with 96 additions and 91 deletions

17
xonsh/python.xsh Normal file
View File

@@ -0,0 +1,17 @@
def _vv():
"""Finds the nearest venv going upward in the directory hierarchy and activates it."""
d = Path.cwd()
while True:
if (d / "venv").exists():
vox activate @(str(d / "venv"))
return True
if d == d.parent or (d / ".git").exists():
print("Could not find venv.")
return False
d = d.parent
aliases["vv"] = _vv