From 2fee7601c357904a1311de6024c4737ec6f44c31 Mon Sep 17 00:00:00 2001 From: GRMrGecko Date: Sat, 20 Aug 2022 00:31:06 -0500 Subject: [PATCH] Added fpath plugin function --- .config/zsh/functions | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.config/zsh/functions b/.config/zsh/functions index 6977287..390ae12 100644 --- a/.config/zsh/functions +++ b/.config/zsh/functions @@ -11,3 +11,11 @@ function zsh_add_plugin() { zsh_add_config "plugins/$PLUGIN_NAME/$PLUGIN_NAME.plugin.zsh" zsh_add_config "plugins/$PLUGIN_NAME/$PLUGIN_NAME.zsh" } + +function zsh_fpath_plugin() { + PLUGIN_NAME=$(echo $1 | cut -d"/" -f2) + if ! [ -d "$ZSH_CONFIG/plugins/$PLUGIN_NAME" ]; then + git clone "https://github.com/$1.git" "$ZSH_CONFIG/plugins/$PLUGIN_NAME" + fi + fpath+=($ZSH_CONFIG/plugins/$PLUGIN_NAME) +}