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.

23 lines
785 B

2 years ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
4 months ago
  1. #!/bin/zsh
  2. function zsh_add_config() {
  3. [ -f "$ZDOTDIR/$1" ] && ! [ -L "$ZDOTDIR/$1" ] && source "$ZDOTDIR/$1"
  4. }
  5. function zsh_add_plugin() {
  6. PLUGIN_NAME=$(echo $1 | cut -d"/" -f2)
  7. if ! [ -d "$ZDOTDIR/plugins/$PLUGIN_NAME" ]; then
  8. git clone "https://github.com/$1.git" "$ZDOTDIR/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. zsh_add_config "plugins/$PLUGIN_NAME/async"
  13. zsh_add_config "plugins/$PLUGIN_NAME/nix.plugin.zsh"
  14. }
  15. function zsh_fpath_plugin() {
  16. PLUGIN_NAME=$(echo $1 | cut -d"/" -f2)
  17. if ! [ -d "$ZDOTDIR/plugins/$PLUGIN_NAME" ]; then
  18. git clone "https://github.com/$1.git" "$ZDOTDIR/plugins/$PLUGIN_NAME"
  19. fi
  20. fpath+=($ZDOTDIR/plugins/$PLUGIN_NAME)
  21. }