diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 473d81600..007b2c024 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -523,15 +523,29 @@ in { set -l plugin_dir ${plugin.src} # Set paths to import plugin components + if test -d $plugin_dir/share/fish/vendor_functions.d + set fish_function_path $fish_function_path[1] $plugin_dir/share/fish/vendor_functions.d $fish_function_path[2..-1] + end + if test -d $plugin_dir/functions set fish_function_path $fish_function_path[1] $plugin_dir/functions $fish_function_path[2..-1] end + if test -d $plugin_dir/share/fish/vendor_completions.d + set fish_complete_path $fish_complete_path[1] $plugin_dir/share/fish/vendor_completions.d $fish_complete_path[2..-1] + end + if test -d $plugin_dir/completions set fish_complete_path $fish_complete_path[1] $plugin_dir/completions $fish_complete_path[2..-1] end # Source initialization code if it exists. + if test -d $plugin_dir/share/fish/vendor_conf.d + for f in $plugin_dir/share/fish/vendor_conf.d/*.fish + source $f + end + end + if test -d $plugin_dir/conf.d for f in $plugin_dir/conf.d/*.fish source $f diff --git a/tests/modules/programs/fish/plugins.nix b/tests/modules/programs/fish/plugins.nix index 88684b3b4..51e31a585 100644 --- a/tests/modules/programs/fish/plugins.nix +++ b/tests/modules/programs/fish/plugins.nix @@ -11,15 +11,29 @@ let set -l plugin_dir ${fooPluginSrc} # Set paths to import plugin components + if test -d $plugin_dir/share/fish/vendor_functions.d + set fish_function_path $fish_function_path[1] $plugin_dir/share/fish/vendor_functions.d $fish_function_path[2..-1] + end + if test -d $plugin_dir/functions set fish_function_path $fish_function_path[1] $plugin_dir/functions $fish_function_path[2..-1] end + if test -d $plugin_dir/share/fish/vendor_completions.d + set fish_complete_path $fish_complete_path[1] $plugin_dir/share/fish/vendor_completions.d $fish_complete_path[2..-1] + end + if test -d $plugin_dir/completions set fish_complete_path $fish_complete_path[1] $plugin_dir/completions $fish_complete_path[2..-1] end # Source initialization code if it exists. + if test -d $plugin_dir/share/fish/vendor_conf.d + for f in $plugin_dir/share/fish/vendor_conf.d/*.fish + source $f + end + end + if test -d $plugin_dir/conf.d for f in $plugin_dir/conf.d/*.fish source $f