directories.zsh 705 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Changing/making/removing directory
  2. setopt auto_name_dirs
  3. setopt auto_pushd
  4. setopt pushd_ignore_dups
  5. alias ..='cd ..'
  6. alias cd..='cd ..'
  7. alias cd...='cd ../..'
  8. alias cd....='cd ../../..'
  9. alias cd.....='cd ../../../..'
  10. alias cd/='cd /'
  11. alias 1='cd -'
  12. alias 2='cd +2'
  13. alias 3='cd +3'
  14. alias 4='cd +4'
  15. alias 5='cd +5'
  16. alias 6='cd +6'
  17. alias 7='cd +7'
  18. alias 8='cd +8'
  19. alias 9='cd +9'
  20. cd () {
  21. if [[ "x$*" == "x..." ]]; then
  22. cd ../..
  23. elif [[ "x$*" == "x...." ]]; then
  24. cd ../../..
  25. elif [[ "x$*" == "x....." ]]; then
  26. cd ../../../..
  27. elif [[ "x$*" == "x......" ]]; then
  28. cd ../../../../..
  29. else
  30. builtin cd "$@"
  31. fi
  32. }
  33. alias md='mkdir -p'
  34. alias rd=rmdir
  35. alias d='dirs -v | head -10'