From 33ec29ec4159be94fd090dffa71ee9ecc1d9f809 Mon Sep 17 00:00:00 2001 From: Bruno Pinto Date: Wed, 25 Jul 2012 01:07:27 -0300 Subject: [PATCH] loading custom plugins and sourcing all files that are not plugins --- oh-my-fish.fish | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/oh-my-fish.fish b/oh-my-fish.fish index 6509cf1..c6dbcdb 100644 --- a/oh-my-fish.fish +++ b/oh-my-fish.fish @@ -1,3 +1,9 @@ +# Set FISH_CUSTOM to the path where your custom config files +# and plugins exists, or else we will use the default custom. +if not set -q FISH_CUSTOM + set -g FISH_CUSTOM $FISH/custom +end + # Extracting user's functions – will be added later. set user_function_path $fish_function_path[1] set -e fish_function_path[1] @@ -13,5 +19,15 @@ end # Add user defined theme to fish_function_path. set fish_function_path /Users/bpinto/.oh-my-fish/themes/$FISH_THEME $fish_function_path +# Add all custom plugins to fish_function_path +for plugin in $FISH_CUSTOM/plugins/* + set fish_function_path $plugin $fish_function_path +end + +# Source all files inside custom folder +for config_file in $FISH_CUSTOM/*.fish + . $config_file +end + # Re-adding user's functions so they have the highest priority set fish_function_path $user_function_path $fish_function_path