python alias

This commit is contained in:
2026-01-24 21:45:48 +08:00
parent 1a949c4497
commit f532737ed9
2 changed files with 19 additions and 2 deletions

View File

@@ -1 +1,16 @@
alias py='python3' if (( $+commands[python3] )); then
alias py='python3'
fi
function pyclean() {
find "${@:-.}" -type f -name "*.py[co]" -delete
find "${@:-.}" -type d -name "__pycache__" -delete
find "${@:-.}" -depth -type d -name ".mypy_cache" -exec rm -r "{}" +
find "${@:-.}" -depth -type d -name ".pytest_cache" -exec rm -r "{}" +
}
# Grep among .py files
alias pygrep='grep -nr --include="*.py"'
# Share local directory as a HTTP server
alias pyserver="python3 -m http.server"

View File

@@ -50,7 +50,9 @@ source $ZSH_POLYJUICE_PLUGINS_PATH/zsh-syntax-highlighting/zsh-syntax-highlighti
source $ZSH_POLYJUICE_PLUGINS_PATH/fzf-tab/fzf-tab.plugin.zsh # relies on fzf itself and zsh-autosuggestions plugin source $ZSH_POLYJUICE_PLUGINS_PATH/fzf-tab/fzf-tab.plugin.zsh # relies on fzf itself and zsh-autosuggestions plugin
source $ZSH_POLYJUICE_PLUGINS_PATH/ohmyzsh/plugins/fzf/fzf.plugin.zsh source $ZSH_POLYJUICE_PLUGINS_PATH/ohmyzsh/plugins/fzf/fzf.plugin.zsh
source $ZSH_POLYJUICE_PLUGINS_PATH/ohmyzsh/plugins/zoxide/zoxide.plugin.zsh source $ZSH_POLYJUICE_PLUGINS_PATH/ohmyzsh/plugins/zoxide/zoxide.plugin.zsh
source $ZSH_POLYJUICE_PLUGINS_PATH/ohmyzsh/plugins/python/python.plugin.zsh
# PYTHON_AUTO_VRUN=true
# source $ZSH_POLYJUICE_PLUGINS_PATH/ohmyzsh/plugins/python/python.plugin.zsh
# using starship as prompt # using starship as prompt