diff --git a/etc/fish.in b/etc/fish.in index 5b5c72edf..1c85fb287 100644 --- a/etc/fish.in +++ b/etc/fish.in @@ -3,13 +3,6 @@ # # @configure_input@ -# -# Set default search paths for completions and shellscript functions -# - -set -g fish_function_path ~/.fish.d/functions @sysconfdir@/fish.d/functions @datadir@/fish/functions -set -g fish_complete_path ~/.fish.d/completions @sysconfdir@/fish.d/completions @datadir@/fish/completions - # # Set default field separators # diff --git a/share/fish.in b/share/fish.in index 0cc0ac503..b1d88b784 100644 --- a/share/fish.in +++ b/share/fish.in @@ -5,10 +5,20 @@ # # @configure_input@ -# Assign a temporary value here for performance reasons. The real -# value should be set in /etc/fish. +# +# Set default search paths for completions and shellscript functions +# unless they already exist +# + +if not set -q fish_function_path + set -U fish_function_path ~/.fish.d/functions @sysconfdir@/fish.d/functions @datadir@/fish/functions +end + +if not set -q fish_complete_path + set -U fish_complete_path ~/.fish.d/completions @sysconfdir@/fish.d/completions @datadir@/fish/completions +end + -set -g fish_function_path @datadir@/fish/functions/ set __fish_help_dir @docdir@ # This is a Solaris-specific test to modify the PATH so that