directories.zsh 840 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Changing/making/removing directory
  2. setopt auto_cd
  3. setopt auto_pushd
  4. setopt pushd_ignore_dups
  5. setopt pushdminus
  6. # add (uncommented):
  7. # zstyle ':omz:directories' aliases no
  8. # to your `zshrc` before loading `oh-my-zsh.sh`
  9. # to disable the following aliases and functions
  10. zstyle -T ':omz:directories' aliases || return 0
  11. alias -g ...='../..'
  12. alias -g ....='../../..'
  13. alias -g .....='../../../..'
  14. alias -g ......='../../../../..'
  15. alias -- -='cd -'
  16. alias 1='cd -1'
  17. alias 2='cd -2'
  18. alias 3='cd -3'
  19. alias 4='cd -4'
  20. alias 5='cd -5'
  21. alias 6='cd -6'
  22. alias 7='cd -7'
  23. alias 8='cd -8'
  24. alias 9='cd -9'
  25. alias md='mkdir -p'
  26. alias rd=rmdir
  27. function d () {
  28. if [[ -n $1 ]]; then
  29. dirs "$@"
  30. else
  31. dirs -v | head -n 10
  32. fi
  33. }
  34. compdef _dirs d
  35. # List directory contents
  36. alias lsa='ls -lah'
  37. alias l='ls -lah'
  38. alias ll='ls -lh'
  39. alias la='ls -lAh'