mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
feat(python): add function for show version of python, pip, venv
This commit is contained in:
parent
095ac3ca8f
commit
ff91a4e16e
2 changed files with 7 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ plugins=(... python)
|
||||||
| `pygrep <text>` | Looks for `text` in `*.py` files in the current directory, recursively |
|
| `pygrep <text>` | Looks for `text` in `*.py` files in the current directory, recursively |
|
||||||
| `pyuserpaths` | Add user site-packages folders to `PYTHONPATH`, for Python 2 and 3 |
|
| `pyuserpaths` | Add user site-packages folders to `PYTHONPATH`, for Python 2 and 3 |
|
||||||
| `pyserver` | Starts an HTTP server on the current directory (use `--directory` for a different one) |
|
| `pyserver` | Starts an HTTP server on the current directory (use `--directory` for a different one) |
|
||||||
|
| `pyver` | Shows the current Python version, pip version, and active virtual environment (if any) |
|
||||||
|
|
||||||
## Virtual environments
|
## Virtual environments
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,3 +120,9 @@ if [[ "$PYTHON_AUTO_VRUN" == "true" ]]; then
|
||||||
add-zsh-hook chpwd auto_vrun
|
add-zsh-hook chpwd auto_vrun
|
||||||
auto_vrun
|
auto_vrun
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function pyver() {
|
||||||
|
echo "Python: $(python3 --version 2>&1)"
|
||||||
|
echo "pip: $(pip --version 2>&1)"
|
||||||
|
echo "Venv: ${VIRTUAL_ENV:-none}"
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue