theme-and-appearance.zsh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # ls colors
  2. autoload -U colors && colors
  3. export LSCOLORS="Gxfxcxdxbxegedabagacad"
  4. # Enable ls colors
  5. if [ "$DISABLE_LS_COLORS" != "true" ]
  6. then
  7. # Find the option for using colors in ls, depending on the version: Linux or BSD
  8. if [[ "$(uname -s)" == "NetBSD" ]]; then
  9. # On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
  10. # otherwise, leave ls as is, because NetBSD's ls doesn't support -G
  11. gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
  12. elif [[ "$(uname -s)" == "OpenBSD" ]]; then
  13. # On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base,
  14. # with color and multibyte support) are available from ports. "colorls"
  15. # will be installed on purpose and can't be pulled in by installing
  16. # coreutils, so prefer it to "gls".
  17. gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
  18. colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
  19. else
  20. ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
  21. fi
  22. fi
  23. setopt auto_cd
  24. setopt multios
  25. if [[ x$WINDOW != x ]]
  26. then
  27. SCREEN_NO="%B$WINDOW%b "
  28. else
  29. SCREEN_NO=""
  30. fi
  31. # Apply theming defaults
  32. PS1="%n@%m:%~%# "
  33. # git theming default: Variables for theming the git info prompt
  34. ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
  35. ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
  36. ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
  37. ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
  38. # Setup the prompt with pretty colors
  39. setopt prompt_subst