My zsh config made from scratch
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.4 KiB

2 years ago
2 years ago
2 years ago
  1. HISTFILE=~/.histfile
  2. HISTSIZE=1000
  3. SAVEHIST=1000
  4. setopt notify
  5. setopt extendedglob
  6. unsetopt beep
  7. bindkey -e
  8. # Force xterm in 256 color mode
  9. case $TERM in (xterm*)
  10. TERM=xterm-256color
  11. esac
  12. if [ -f $HOME/.profile ]; then
  13. source $HOME/.profile
  14. fi
  15. # Source local zsh configs
  16. if [ -f $HOME/.zshrc_local ]; then
  17. source $HOME/.zshrc_local
  18. fi
  19. # Source modules
  20. if [ -d "$HOME/.zshrc.d" ]; then
  21. for sh in $HOME/.zshrc.d/*.zsh(N) ; do
  22. [ -r "$sh" ] && source "$sh"
  23. done
  24. fi
  25. # Source color tags for hostnames
  26. if [ -f $HOME/.zsh_host_colors ]; then
  27. source $HOME/.zsh_host_colors
  28. HOST_COLOR="${HOST_COLORS[$(cat /etc/hostname | tr -d '\n')]}"
  29. fi
  30. # Default to none if not defined
  31. if [ -z "$HOST_COLOR" ]; then
  32. HOST_COLOR="none"
  33. fi
  34. # Source color tags for usernames
  35. if [ -f $HOME/.zsh_user_colors ]; then
  36. source $HOME/.zsh_user_colors
  37. USER_COLOR="${USER_COLORS[$USER]}"
  38. fi
  39. # Default to none if not defined
  40. if [ -z "$USER_COLOR" ]; then
  41. USER_COLOR="none"
  42. fi
  43. # Prompt
  44. PS1="%F{$USER_COLOR}%n%f@%F{$HOST_COLOR}%m %F{green}%/%f
  45. $ "
  46. declare -a PLUGINS
  47. PLUGINS=(
  48. "/data/data/com.termux/files/usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh"
  49. "/usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh"
  50. "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
  51. )
  52. declare -r PLUGINS
  53. for plugin in $PLUGINS; do
  54. if [ -e "$plugin" ]; then
  55. source $plugin
  56. fi
  57. done