python.plugin.zsh 492 B

123456789101112131415
  1. # Find python file
  2. alias pyfind='find . -name "*.py"'
  3. # Remove python compiled byte-code and mypy cache in either current directory or in a
  4. # list of specified directories
  5. function pyclean() {
  6. ZSH_PYCLEAN_PLACES=${*:-'.'}
  7. find ${ZSH_PYCLEAN_PLACES} -type f -name "*.py[co]" -delete
  8. find ${ZSH_PYCLEAN_PLACES} -type d -name "__pycache__" -delete
  9. find ${ZSH_PYCLEAN_PLACES} -type d -name ".mypy_cache" -delete
  10. }
  11. # Grep among .py files
  12. alias pygrep='grep -r --include="*.py"'