theme-and-appearance.zsh 2.0 KB

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