From e0785f89495ea47125f2050f253fdac0347a5d4a Mon Sep 17 00:00:00 2001 From: Bruno Pinto Date: Sun, 29 Jul 2012 01:14:44 -0300 Subject: [PATCH] loading all .load.fish files even inside plugins --- oh-my-fish.fish | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/oh-my-fish.fish b/oh-my-fish.fish index e665c73..4f2c51e 100644 --- a/oh-my-fish.fish +++ b/oh-my-fish.fish @@ -28,6 +28,19 @@ function _fish_add_completion end end +function _fish_source_plugin_load_file + set -l plugin $argv[1] + set -l load_file_path "plugins/$plugin/$plugin.load.fish" + + if test -e $FISH/$load_file_path + . $FISH/$load_file_path + end + + if test -e $FISH_CUSTOM/$load_file_path + . $FISH_CUSTOM/$load_file_path + end +end + ### # Configuration ### @@ -49,13 +62,14 @@ set fish_function_path $FISH/functions/ $fish_function_path for plugin in $FISH_PLUGINS _fish_add_plugin $plugin _fish_add_completion $plugin + _fish_source_plugin_load_file $plugin end # Add user defined theme set fish_function_path $FISH/themes/$FISH_THEME $fish_function_path # Source all files inside custom folder -for config_file in $FISH_CUSTOM/*.fish +for config_file in $FISH_CUSTOM/*.load.fish . $config_file end