init.zsh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #
  2. # generic options and environment settings
  3. #
  4. # Use smart URL pasting and escaping.
  5. autoload -Uz bracketed-paste-url-magic && zle -N bracketed-paste bracketed-paste-url-magic
  6. autoload -Uz url-quote-magic && zle -N self-insert url-quote-magic
  7. # Treat single word simple commands without redirection as candidates for resumption of an existing job.
  8. setopt AUTO_RESUME
  9. # Allow comments starting with `#` even in interactive shells.
  10. setopt INTERACTIVE_COMMENTS
  11. # List jobs in the long format by default.
  12. setopt LONG_LIST_JOBS
  13. # Report the status of background jobs immediately, rather than waiting until just before printing a prompt.
  14. setopt NOTIFY
  15. # Prevent runing all background jobs at a lower priority.
  16. setopt NO_BG_NICE
  17. # Prevent reporting the status of background and suspended jobs before exiting a shell with job control.
  18. # NO_CHECK_JOBS is best used only in combination with NO_HUP, else such jobs will be killed automatically.
  19. setopt NO_CHECK_JOBS
  20. # Prevent sending the HUP signal to running jobs when the shell exits.
  21. setopt NO_HUP
  22. # Remove path separtor from WORDCHARS.
  23. WORDCHARS=${WORDCHARS//[\/]}
  24. # Set less or more as the default pager.
  25. if (( ! ${+PAGER} )); then
  26. if (( ${+commands[less]} )); then
  27. export PAGER=less
  28. else
  29. export PAGER=more
  30. fi
  31. fi
  32. # sets the window title and updates upon directory change
  33. # more work probably needs to be done here to support multiplexers
  34. if (( ${+ztermtitle} )); then
  35. case ${TERM} in
  36. xterm*|*rxvt)
  37. precmd() { print -Pn "\e]0;${ztermtitle}\a" }
  38. precmd # we execute it once to initialize the window title
  39. ;;
  40. esac
  41. fi