directories.zsh 633 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Changing/making/removing directory
  2. setopt auto_cd
  3. setopt auto_pushd
  4. setopt pushd_ignore_dups
  5. setopt pushdminus
  6. alias -g ...='../..'
  7. alias -g ....='../../..'
  8. alias -g .....='../../../..'
  9. alias -g ......='../../../../..'
  10. alias -- -='cd -'
  11. alias 1='cd -1'
  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. alias md='mkdir -p'
  21. alias rd=rmdir
  22. function d () {
  23. if [[ -n $1 ]]; then
  24. dirs "$@"
  25. else
  26. dirs -v | head -n 10
  27. fi
  28. }
  29. compdef _dirs d
  30. # List directory contents
  31. alias lsa='ls -lah'
  32. alias l='ls -lah'
  33. alias ll='ls -lh'
  34. alias la='ls -lAh'