theme-and-appearance.zsh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 [[ "$(uname -s)" == "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 [[ "$(uname -s)" == "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. else
  19. # For GNU ls, we use the default ls color theme. They can later be overwritten by themes.
  20. if [[ -z "$LS_COLORS" ]]; then
  21. (( $+commands[dircolors] )) && eval "$(dircolors -b)"
  22. fi
  23. ls --color -d . &>/dev/null && alias ls='ls --color=tty' || alias ls='ls -G'
  24. fi
  25. fi
  26. setopt auto_cd
  27. setopt multios
  28. setopt prompt_subst
  29. [[ -n "$WINDOW" ]] && SCREEN_NO="%B$WINDOW%b " || SCREEN_NO=""
  30. # Apply theming defaults
  31. PS1="%n@%m:%~%# "
  32. # git theming default: Variables for theming the git info prompt
  33. ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
  34. ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
  35. ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
  36. ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean