1
0

zshrc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Device-specifig setup (ignored by git)
  2. # source local config first to overwrite default theme if wanted
  3. source .zsh_local
  4. # Source Prezto.
  5. if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
  6. source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
  7. fi
  8. ### U S E R C O N F I G ###
  9. # random string function
  10. random-string()
  11. {
  12. LC_CTYPE=C tr -dc A-Za-z0-9 < /dev/urandom | fold -w ${1:-32} | head -n 1
  13. }
  14. # make code printable with pandocs
  15. # printable-code filename.ext [forced-extension]
  16. printable-code()
  17. {
  18. body=`cat ${1}`
  19. [[ ${1} =~ "([^.]+).([^.]+)" ]] && name=$match[1] && ext=$match[2]
  20. ext=`test -n "${2}" && echo ${2} || echo $ext`
  21. doc="# ${1}\n\`\`\`$ext\n$body\n\`\`\`"
  22. oformat=`test -n "${3}" && echo ${3} || "pdf"`
  23. echo $doc | pandoc -o "$name.$oformat"
  24. }
  25. #
  26. # Aliases
  27. #
  28. # Git
  29. alias glol="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
  30. alias glola="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all"
  31. # Utility
  32. alias rm="nocorrect rm"
  33. #
  34. # Python
  35. #
  36. # virtualenvwrapper
  37. source virtualenvwrapper.sh
  38. export VIRTUAL_ENV_DISABLE_PROMT=yes