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.

21 lines
708 B

2 years ago
2 years ago
2 years ago
  1. #!/bin/zsh
  2. function zsh_add_config() {
  3. [ -f "$ZSH_CONFIG/$1" ] && ! [ -L "$ZSH_CONFIG/$1" ] && source "$ZSH_CONFIG/$1"
  4. }
  5. function zsh_add_plugin() {
  6. PLUGIN_NAME=$(echo $1 | cut -d"/" -f2)
  7. if ! [ -d "$ZSH_CONFIG/plugins/$PLUGIN_NAME" ]; then
  8. git clone "https://github.com/$1.git" "$ZSH_CONFIG/plugins/$PLUGIN_NAME"
  9. fi
  10. zsh_add_config "plugins/$PLUGIN_NAME/$PLUGIN_NAME.plugin.zsh"
  11. zsh_add_config "plugins/$PLUGIN_NAME/$PLUGIN_NAME.zsh"
  12. }
  13. function zsh_fpath_plugin() {
  14. PLUGIN_NAME=$(echo $1 | cut -d"/" -f2)
  15. if ! [ -d "$ZSH_CONFIG/plugins/$PLUGIN_NAME" ]; then
  16. git clone "https://github.com/$1.git" "$ZSH_CONFIG/plugins/$PLUGIN_NAME"
  17. fi
  18. fpath+=($ZSH_CONFIG/plugins/$PLUGIN_NAME)
  19. }