alias.zsh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Editor
  2. -exe emacs \
  3. && export EDITOR="emacs -nw"
  4. alias e=$EDITOR
  5. # common aliases
  6. alias rm="rm -i"
  7. alias mv="mv -i"
  8. alias cp="cp -i"
  9. alias vlock="clear; vlock"
  10. alias df="df -h"
  11. alias rsu="sudo zsh"
  12. alias reload="exec zsh"
  13. alias grep="grep --color=tty"
  14. alias slog="tail -n 60 -f /var/log/syslog"
  15. alias mlog="tail -n 60 -f /var/log/mail.log"
  16. # using colortail if available (freebsd)
  17. -exe colortail \
  18. && alias slog="colortail -n 60 -k /usr/local/share/examples/colortail/conf.messages -f /var/log/syslog"
  19. [ -n "$EDITOR" -a -n "$SUDO_USER" -a $UID = 0 -a $EDITOR[1,5] = "emacs" ] \
  20. && alias e="$EDITOR -u $SUDO_USER"
  21. -exe ccze \
  22. && alias slog="tail -n 60 -f /var/log/syslog | ccze" \
  23. && alias mlog="tail -n 60 -f /var/log/mail.log | ccze"
  24. -exe pydf \
  25. && alias df="pydf -h"
  26. -exe colormake \
  27. && alias make="colormake"
  28. # git stuff
  29. [ -z "$GIT_PAGER" ] \
  30. && [ -x =less ] && export GIT_PAGER=less
  31. [ -z "$GIT_PAGER" ] \
  32. && [ -x =more ] && export GIT_PAGER=more
  33. [ -z "$GIT_PAGER" ] \
  34. && export GIT_PAGER=cat
  35. alias git="PAGER=$GIT_PAGER git"
  36. unset GIT_PAGER
  37. # Pager stuff
  38. -exe most \
  39. && export PAGER=most && alias more='most' && alias less='most'