2006-10-19 11:50:23 +00:00
|
|
|
#
|
|
|
|
# Main file for fish command completions. This file contains various
|
|
|
|
# common helper functions for the command completions. All actual
|
|
|
|
# completions are located in the completions subdirectory.
|
|
|
|
#
|
|
|
|
# @configure_input@
|
|
|
|
|
2007-04-22 18:49:56 +00:00
|
|
|
#
|
|
|
|
# Set default field separators
|
|
|
|
#
|
|
|
|
|
|
|
|
set -g IFS \n\ \t
|
|
|
|
|
2006-10-19 11:50:23 +00:00
|
|
|
#
|
|
|
|
# Set default search paths for completions and shellscript functions
|
|
|
|
# unless they already exist
|
|
|
|
#
|
|
|
|
|
|
|
|
set -l configdir ~/.config
|
|
|
|
if set -q XDG_CONFIG_HOME
|
|
|
|
set configdir $XDG_CONFIG_HOME
|
|
|
|
end
|
|
|
|
|
2006-11-17 16:24:38 +00:00
|
|
|
if not set -q __fish_datadir
|
|
|
|
set -U __fish_datadir @datadir@/fish
|
|
|
|
end
|
2006-10-19 11:50:23 +00:00
|
|
|
|
|
|
|
if not set -q fish_function_path
|
|
|
|
set -U fish_function_path $configdir/fish/functions @sysconfdir@/fish/functions @datadir@/fish/functions
|
|
|
|
end
|
|
|
|
|
|
|
|
if not set -q fish_complete_path
|
|
|
|
set -U fish_complete_path $configdir/fish/completions @sysconfdir@/fish/completions @datadir@/fish/completions
|
|
|
|
end
|
|
|
|
|
|
|
|
set __fish_help_dir @docdir@
|
|
|
|
|
|
|
|
# This is a Solaris-specific test to modify the PATH so that
|
|
|
|
# Posix-conformant tools are used by default.
|
|
|
|
|
|
|
|
if test -d /usr/xpg4/bin
|
|
|
|
if not contains /usr/xpg4/bin $PATH
|
|
|
|
set PATH /usr/xpg4/bin $PATH
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Make sure there are no invalid entries in the PATH
|
|
|
|
#
|
|
|
|
|
|
|
|
if status --is-interactive
|
2007-01-21 15:50:57 +00:00
|
|
|
set -l new_path
|
|
|
|
for i in $PATH
|
2006-10-19 11:50:23 +00:00
|
|
|
if not test -d $i
|
|
|
|
printf (_ '%s: Warning: The directory %s has been removed from your PATH because it does not exist\n') fish $i
|
2007-01-21 15:50:57 +00:00
|
|
|
else
|
|
|
|
set new_path $new_path $i
|
2006-10-19 11:50:23 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2007-01-21 15:50:57 +00:00
|
|
|
set PATH $new_path
|
2006-10-19 11:50:23 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Add a few common directories to path, if they exists. Note that pure
|
|
|
|
# console programs like makedep sometimes live in /usr/X11R6/bin, so we
|
|
|
|
# want this even for text-only terminals.
|
|
|
|
#
|
|
|
|
|
|
|
|
set -l path_list /bin /usr/bin /usr/X11R6/bin @prefix@/bin @optbindirs@
|
|
|
|
|
|
|
|
# Root should also have the sbin directories in the path
|
|
|
|
if test "$USER" = root
|
|
|
|
set path_list $path_list /sbin /usr/sbin /usr/local/sbin
|
|
|
|
end
|
|
|
|
|
|
|
|
# Make a regular expression that matches any component in the PATH. A
|
|
|
|
# trailing slash is ok. The sed call is to remove the last '|'.
|
|
|
|
set -l tmp (printf "%s" \^$PATH'/?$|')
|
|
|
|
set -l path_regexp \((echo $tmp | sed -e "s/.\$//")\)
|
|
|
|
|
2006-11-29 14:00:04 +00:00
|
|
|
for i in (printf "%s\n" $path_list|sgrep -E -v $path_regexp)
|
2006-10-19 11:50:23 +00:00
|
|
|
if test -d $i
|
|
|
|
set PATH $PATH $i
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2007-04-23 21:10:26 +00:00
|
|
|
# Launch debugger on SIGTRAP
|
|
|
|
function fish_sigtrap_handler --on-signal TRAP --no-scope-shadowing --description "Signal handler for the TRAP signal. Lanches a debug prompt."
|
|
|
|
breakpoint
|
|
|
|
end
|
2006-10-19 11:50:23 +00:00
|
|
|
|
|
|
|
if status --is-interactive
|
|
|
|
. config_interactive.fish
|
|
|
|
end
|