python.plugin.zsh 489 Bytes
Newer Older
1
2
3
# Find python file
alias pyfind='find . -name "*.py"'

4
# Remove python compiled byte-code and mypy cache in either current directory or in a
5
6
7
8
# list of specified directories
function pyclean() {
    ZSH_PYCLEAN_PLACES=${*:-'.'}
    find ${ZSH_PYCLEAN_PLACES} -type f -name "*.py[co]" -delete
Carlos Cardoso's avatar
Carlos Cardoso committed
9
    find ${ZSH_PYCLEAN_PLACES} -type d -name "__pycache__" -delete
10
    find ${ZSH_PYCLEAN_PLACES} -type d -name ".mypy_cache" -delete
11
}
12
13
14

# Grep among .py files
alias pygrep='grep --include="*.py"'
15