mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-24 10:46:59 +08:00
db0a982570
darcs-hash:20070928213821-75c98-65fb9e2159bfef7ab04468511378ac3efbf2308e.gz
88 lines
2.0 KiB
Fish
88 lines
2.0 KiB
Fish
#
|
|
# 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@
|
|
|
|
#
|
|
# Set default field separators
|
|
#
|
|
|
|
set -g IFS \n\ \t
|
|
|
|
#
|
|
# 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
|
|
|
|
if not set -q __fish_datadir
|
|
set -g __fish_datadir @datadir@/fish
|
|
end
|
|
|
|
if not set -q __fish_sysconfdir
|
|
set -g __fish_sysconfdir @sysconfdir@/fish
|
|
end
|
|
|
|
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
|
|
|
|
#
|
|
# 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
|
|
switch $USER
|
|
case root
|
|
set path_list $path_list /sbin /usr/sbin /usr/local/sbin
|
|
end
|
|
|
|
for i in $path_list
|
|
if not contains $i $PATH
|
|
if test -d $i
|
|
set PATH $PATH $i
|
|
end
|
|
end
|
|
end
|
|
|
|
#
|
|
# 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
|
|
|
|
#
|
|
# Whenever a prompt is displayed, make sure that interactive
|
|
# mode-specific initializations have been performed.
|
|
#
|
|
function __fish_on_interactive --on-event fish_prompt
|
|
__fish_config_interactive
|
|
end
|
|
|