aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions
diff options
context:
space:
mode:
Diffstat (limited to 'share/functions')
-rw-r--r--share/functions/__fish_append.fish2
-rw-r--r--share/functions/__fish_bind_test1.fish4
-rw-r--r--share/functions/__fish_bind_test2.fish2
-rw-r--r--share/functions/__fish_commandline_test.fish4
-rw-r--r--share/functions/__fish_complete_ant_targets.fish2
-rw-r--r--share/functions/__fish_complete_cd.fish6
-rw-r--r--share/functions/__fish_complete_file_url.fish2
-rw-r--r--share/functions/__fish_complete_ls.fish28
-rw-r--r--share/functions/__fish_complete_man.fish6
-rw-r--r--share/functions/__fish_complete_subcommand.fish2
-rw-r--r--share/functions/__fish_complete_subcommand_root.fish2
-rw-r--r--share/functions/__fish_complete_suffix.fish6
-rw-r--r--share/functions/__fish_complete_tar.fish6
-rw-r--r--share/functions/__fish_complete_unrar.fish2
-rw-r--r--share/functions/__fish_complete_vi.fish6
-rw-r--r--share/functions/__fish_config_interactive.fish28
-rw-r--r--share/functions/__fish_contains_opt.fish10
-rw-r--r--share/functions/__fish_crux_packages.fish2
-rw-r--r--share/functions/__fish_gnu_complete.fish6
-rw-r--r--share/functions/__fish_move_last.fish6
-rw-r--r--share/functions/__fish_no_arguments.fish2
-rw-r--r--share/functions/__fish_not_contain_opt.fish10
-rw-r--r--share/functions/__fish_paginate.fish2
-rw-r--r--share/functions/__fish_print_filesystems.fish6
-rw-r--r--share/functions/__fish_print_help.fish2
-rw-r--r--share/functions/__fish_print_packages.fish8
-rw-r--r--share/functions/__fish_prt_use_package.fish2
-rw-r--r--share/functions/cd.fish2
-rw-r--r--share/functions/dirh.fish4
-rw-r--r--share/functions/down-or-search.fish4
-rw-r--r--share/functions/fish_default_key_bindings.fish26
-rw-r--r--share/functions/funced.fish8
-rw-r--r--share/functions/grep.fish4
-rw-r--r--share/functions/help.fish6
-rw-r--r--share/functions/isatty.fish4
-rw-r--r--share/functions/math.fish2
-rw-r--r--share/functions/nextd.fish4
-rw-r--r--share/functions/prevd.fish4
-rw-r--r--share/functions/prompt_pwd.fish2
-rw-r--r--share/functions/psub.fish6
-rw-r--r--share/functions/pwd.fish2
-rw-r--r--share/functions/trap.fish20
-rw-r--r--share/functions/type.fish10
-rw-r--r--share/functions/umask.fish14
-rw-r--r--share/functions/up-or-search.fish4
45 files changed, 145 insertions, 145 deletions
diff --git a/share/functions/__fish_append.fish b/share/functions/__fish_append.fish
index 41b92d43..43caa26c 100644
--- a/share/functions/__fish_append.fish
+++ b/share/functions/__fish_append.fish
@@ -1,7 +1,7 @@
function __fish_append -d "Internal completion function for appending string to the commandline" --argument separator
set -e argv[1]
set str (commandline -tc| sed -ne "s/\(.*$separator\)[^$separator]*/\1/p"|sed -e "s/--.*=//")
- printf "%s\n" "$str"$argv "$str"(printf "%s\n" $argv|sed -e "s/\(\t\|\$\)/,\1/")
+ printf "%s\n" "$str"$argv "$str"(printf "%s\n" $argv|sed -e "s/\(\t\|\$\)/,\1/")
end
diff --git a/share/functions/__fish_bind_test1.fish b/share/functions/__fish_bind_test1.fish
index 37f5eeb0..b4380c18 100644
--- a/share/functions/__fish_bind_test1.fish
+++ b/share/functions/__fish_bind_test1.fish
@@ -3,13 +3,13 @@ function __fish_bind_test1
set -l args
set -l use_keys no
-for i in (commandline -poc)
+for i in (commandline -poc)
switch $i
case -k --k --ke --key
set use_keys yes
case "-*"
-
+
case "*"
set args $args $i
end
diff --git a/share/functions/__fish_bind_test2.fish b/share/functions/__fish_bind_test2.fish
index 8530451c..4c7f684a 100644
--- a/share/functions/__fish_bind_test2.fish
+++ b/share/functions/__fish_bind_test2.fish
@@ -4,7 +4,7 @@ set -l args
for i in (commandline -poc)
switch $i
case "-*"
-
+
case "*"
set args $args $i
end
diff --git a/share/functions/__fish_commandline_test.fish b/share/functions/__fish_commandline_test.fish
index af533eb2..a32512cf 100644
--- a/share/functions/__fish_commandline_test.fish
+++ b/share/functions/__fish_commandline_test.fish
@@ -2,7 +2,7 @@
function __fish_commandline_test
set -l is_function no
-for i in (commandline -poc)
+for i in (commandline -poc)
switch $i
case -f --f --fu --fun --func --funct --functi --functio --function
set is_function yes
@@ -10,7 +10,7 @@ for i in (commandline -poc)
case --
break
-
+
end
end
diff --git a/share/functions/__fish_complete_ant_targets.fish b/share/functions/__fish_complete_ant_targets.fish
index f8b28643..61dde00a 100644
--- a/share/functions/__fish_complete_ant_targets.fish
+++ b/share/functions/__fish_complete_ant_targets.fish
@@ -8,7 +8,7 @@ function __fish_complete_ant_targets -d "Print list of targets from build.xml an
set files (sed -n "s/^.*<import[^>]* file=[\"']\([^\"']*\)[\"'].*\$/\1/p" < $buildfile)
# iterate through files and display their targets
- for file in $files;
+ for file in $files;
__fish_filter_ant_targets $file
end
end
diff --git a/share/functions/__fish_complete_cd.fish b/share/functions/__fish_complete_cd.fish
index 1ca88af3..dbc7f766 100644
--- a/share/functions/__fish_complete_cd.fish
+++ b/share/functions/__fish_complete_cd.fish
@@ -17,17 +17,17 @@ function __fish_complete_cd -d "Completions for the cd command"
set mycdpath $CDPATH
end
-
+
if echo (commandline -ct)|sgrep '^/\|^\./\|^\.\./' >/dev/null
# This is an absolute search path
eval printf '\%s\\tDirectory\\n' (commandline -ct)\*/
else
# This is a relative search path
- # Iterate over every directory in CDPATH
+ # Iterate over every directory in CDPATH
# and check for possible completions
for i in $mycdpath
- # Move to the initial directory first,
+ # Move to the initial directory first,
# in case the CDPATH directory is relative
builtin cd $wd
diff --git a/share/functions/__fish_complete_file_url.fish b/share/functions/__fish_complete_file_url.fish
index a85bd55c..28af1808 100644
--- a/share/functions/__fish_complete_file_url.fish
+++ b/share/functions/__fish_complete_file_url.fish
@@ -12,7 +12,7 @@ function __fish_complete_file_url
if test file:// = $prefix
set -l stripped (echo $comp|cut -c 8-)
- printf "%s\n" file://(complete -C"echo $stripped")
+ printf "%s\n" file://(complete -C"echo $stripped")
else
echo file://
end
diff --git a/share/functions/__fish_complete_ls.fish b/share/functions/__fish_complete_ls.fish
index ff3bf4e0..652a02d3 100644
--- a/share/functions/__fish_complete_ls.fish
+++ b/share/functions/__fish_complete_ls.fish
@@ -5,14 +5,14 @@
# Test if we are using GNU ls
function __fish_complete_ls -d "Compleletions for ls and its aliases"
-
- set -l is_gnu
+
+ set -l is_gnu
command ls --version >/dev/null ^/dev/null; and set is_gnu --is-gnu
-
+
set -l cmds -c $argv
-
+
# Shared ls switches
-
+
__fish_gnu_complete $cmds -s a -l all --description "Show hidden" $is_gnu
__fish_gnu_complete $cmds -s A -l almost-all --description "Show hidden except . and .." $is_gnu
__fish_gnu_complete $cmds -s F -l classify --description "Append filetype indicator" $is_gnu
@@ -28,7 +28,7 @@ function __fish_complete_ls -d "Compleletions for ls and its aliases"
__fish_gnu_complete $cmds -s q -l hide-control-chars --description "Replace non-graphic characters with '?'" $is_gnu
__fish_gnu_complete $cmds -s r -l reverse --description "Reverse sort order" $is_gnu
__fish_gnu_complete $cmds -s s -l size --description "Print size of files" $is_gnu
-
+
complete $cmds -s C --description "List by columns"
complete $cmds -s S --description "Sort by size"
complete $cmds -s c --description "Show and sort by ctime"
@@ -41,11 +41,11 @@ function __fish_complete_ls -d "Compleletions for ls and its aliases"
complete $cmds -s u --description "Show access time"
complete $cmds -s x --description "List entries by lines"
complete $cmds -s 1 --description "List one file per line"
-
+
if test -n "$is_gnu"
-
+
# GNU specific ls switches
-
+
complete $cmds -l hide --description "Do not list implied entries matching specified shell pattern" -r
complete $cmds -l lcontext --description "Display security context"
complete $cmds -l context -s Z --description "Display security context so it fits on most displays"
@@ -94,11 +94,11 @@ function __fish_complete_ls -d "Compleletions for ls and its aliases"
complete $cmds -s X --description "Sort by extension"
complete $cmds -l help --description "Display help and exit"
complete $cmds -l version --description "Display version and exit"
-
+
else
-
+
# If not a GNU system, assume we have standard BSD ls features instead
-
+
complete $cmds -s B --description "Octal escapes for non graphic characters"
complete $cmds -s G --description "Use colors"
complete $cmds -s I --description "Prevent -A from being automatically set for root"
@@ -108,7 +108,7 @@ function __fish_complete_ls -d "Compleletions for ls and its aliases"
complete $cmds -s Z --description "Display each file's MAC label"
complete $cmds -s o --description "Include the file flags in a long (-l) output"
complete $cmds -s w --description "Print raw entry names"
-
+
end
-
+
end
diff --git a/share/functions/__fish_complete_man.fish b/share/functions/__fish_complete_man.fish
index dad6ed0d..7be041f0 100644
--- a/share/functions/__fish_complete_man.fish
+++ b/share/functions/__fish_complete_man.fish
@@ -1,5 +1,5 @@
-function __fish_complete_man
+function __fish_complete_man
if test (commandline -ct)
# Try to guess what section to search in. If we don't know, we
@@ -11,13 +11,13 @@ function __fish_complete_man
while count $prev
switch $prev[1]
case '-**'
-
+
case '*'
set section $prev[1]
end
set -e prev[1]
end
-
+
set section $section"[^)]*"
# Do the actual search
diff --git a/share/functions/__fish_complete_subcommand.fish b/share/functions/__fish_complete_subcommand.fish
index 78803a88..c002b812 100644
--- a/share/functions/__fish_complete_subcommand.fish
+++ b/share/functions/__fish_complete_subcommand.fish
@@ -24,7 +24,7 @@ function __fish_complete_subcommand -d "Complete subcommand"
switch $i
case '-*'
case '*=*'
-
+
case '*'
set had_cmd 1
set res $i
diff --git a/share/functions/__fish_complete_subcommand_root.fish b/share/functions/__fish_complete_subcommand_root.fish
index 49504ce4..b6b2152e 100644
--- a/share/functions/__fish_complete_subcommand_root.fish
+++ b/share/functions/__fish_complete_subcommand_root.fish
@@ -1,7 +1,7 @@
function __fish_complete_subcommand_root -d "Run the __fish_complete_subcommand function using a PATH containing /sbin and /usr/sbin"
- set -l PATH_OLD $PATH
+ set -l PATH_OLD $PATH
set PATH /sbin /usr/sbin $PATH
__fish_complete_subcommand
set PATH $PATH_OLD
diff --git a/share/functions/__fish_complete_suffix.fish b/share/functions/__fish_complete_suffix.fish
index 035911a7..5abdb2ff 100644
--- a/share/functions/__fish_complete_suffix.fish
+++ b/share/functions/__fish_complete_suffix.fish
@@ -9,9 +9,9 @@ function __fish_complete_suffix -d "Complete using files"
# Variable declarations
- set -l comp
- set -l suff
- set -l desc
+ set -l comp
+ set -l suff
+ set -l desc
set -l files
switch (count $argv)
diff --git a/share/functions/__fish_complete_tar.fish b/share/functions/__fish_complete_tar.fish
index f19d6727..91a79501 100644
--- a/share/functions/__fish_complete_tar.fish
+++ b/share/functions/__fish_complete_tar.fish
@@ -11,21 +11,21 @@ function __fish_complete_tar -d "Peek inside of archives and list all files"
case '*.tar.bz' '*.tar.bz2' '*.tbz' '*.tbz2'
if test -f $i
set -l file_list (tar -jt <$i)
- printf (_ "%s\tArchived file\n") $file_list
+ printf (_ "%s\tArchived file\n") $file_list
end
return
case '*.tar.gz' '*.tgz'
if test -f $i
set -l file_list (tar -it <$i)
- printf (_ "%s\tArchived file\n") $file_list
+ printf (_ "%s\tArchived file\n") $file_list
end
return
case '*.tar'
if test -f $i
set -l file_list (tar -t <$i)
- printf (_ "%s\tArchived file\n") $file_list
+ printf (_ "%s\tArchived file\n") $file_list
end
return
end
diff --git a/share/functions/__fish_complete_unrar.fish b/share/functions/__fish_complete_unrar.fish
index b9a0fda1..1c86794e 100644
--- a/share/functions/__fish_complete_unrar.fish
+++ b/share/functions/__fish_complete_unrar.fish
@@ -11,7 +11,7 @@ function __fish_complete_unrar -d "Peek inside of archives and list all files"
case '*.rar'
if test -f $i
set -l file_list (unrar vb $i)
- printf (_ "%s\tArchived file\n") $file_list
+ printf (_ "%s\tArchived file\n") $file_list
end
return
end
diff --git a/share/functions/__fish_complete_vi.fish b/share/functions/__fish_complete_vi.fish
index 7b756f29..ba7dc10b 100644
--- a/share/functions/__fish_complete_vi.fish
+++ b/share/functions/__fish_complete_vi.fish
@@ -4,13 +4,13 @@ function __fish_complete_vi -d "Compleletions for vi and its aliases"
set -l is_vim
command vi --version >/dev/null ^/dev/null; and set is_vim vim
-
+
set -l cmds -c $argv
# vim
if test -n "$is_vim"
-
+
# these don't work
#complete $cmds -a - --description 'The file to edit is read from stdin. Commands are read from stderr, which should be a tty'
@@ -105,7 +105,7 @@ function __fish_complete_vi -d "Compleletions for vi and its aliases"
complete $cmds -r -c t --description 'Begin editing by executing the specified editor command'
end
-
+
end
diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish
index 11ad9854..e2ace3f0 100644
--- a/share/functions/__fish_config_interactive.fish
+++ b/share/functions/__fish_config_interactive.fish
@@ -32,8 +32,8 @@ function __fish_config_interactive -d "Initializations that should be performed
end
if test -d $configdir
- if command mkdir $configdir/fish
-
+ if command mkdir $configdir/fish
+
# These files are sometimes overwritten to by fish, so
# we want backups of them in case something goes wrong
@@ -51,7 +51,7 @@ function __fish_config_interactive -d "Initializations that should be performed
#
# Move the fishd stuff from another shell to avoid concurrency problems
#
-
+
/bin/sh -c mv\ \~/.fishd.(hostname)\ $configdir/fish/fishd.(hostname)\;kill\ -9\ (echo %fishd)
# Update paths to point to new configuration locations
@@ -70,12 +70,12 @@ function __fish_config_interactive -d "Initializations that should be performed
# Make sure this is only done once
set -U __fish_init_1_22_0
-
+
end
#
# If we are starting up for the first time, set various defaults
- #
+ #
if not set -q __fish_init_1_23_0
if not set -q fish_greeting
@@ -91,7 +91,7 @@ function __fish_config_interactive -d "Initializations that should be performed
function set_default -d "Set a universal variable, unless it has already been set"
if not set -q $argv[1]
- set -U -- $argv
+ set -U -- $argv
end
end
@@ -139,11 +139,11 @@ function __fish_config_interactive -d "Initializations that should be performed
#
functions -e set_default
-
+
end
#
- # Print a greeting
+ # Print a greeting
#
if functions -q fish_greeting
@@ -153,7 +153,7 @@ function __fish_config_interactive -d "Initializations that should be performed
switch $fish_greeting
case ''
# If variable is empty, don't print anything, saves us a fork
-
+
case '*'
echo $fish_greeting
end
@@ -189,7 +189,7 @@ function __fish_config_interactive -d "Initializations that should be performed
end
#
- # Completions for SysV startup scripts. These aren't bound to any
+ # Completions for SysV startup scripts. These aren't bound to any
# specific command, so they can't be autoloaded.
#
@@ -203,11 +203,11 @@ function __fish_config_interactive -d "Initializations that should be performed
if not set -q fish_key_bindings
set -U fish_key_bindings fish_default_key_bindings
end
-
+
# Reload keybindings when binding variable change
function __fish_reload_key_bindings -d "Reload keybindings when binding variable change" --on-variable fish_key_bindings
eval $fish_key_bindings ^/dev/null
- end
+ end
# Load keybindings
__fish_reload_key_bindings
@@ -220,11 +220,11 @@ function __fish_config_interactive -d "Initializations that should be performed
# If the ubuntu command-not-found package can be found, add a handler for it
# First check in /usr/lib, this is where modern Ubuntus place this command
- if test -f /usr/lib/command-not-found
+ if test -f /usr/lib/command-not-found
function fish_command_not_found_handler --on-event fish_command_not_found
/usr/lib/command-not-found $argv
end
- else
+ else
# Ubuntu Feisty places this command in the regular path instead
if type -p command-not-found >/dev/null
function fish_command_not_found_handler --on-event fish_command_not_found
diff --git a/share/functions/__fish_contains_opt.fish b/share/functions/__fish_contains_opt.fish
index f38adb40..b786fe3b 100644
--- a/share/functions/__fish_contains_opt.fish
+++ b/share/functions/__fish_contains_opt.fish
@@ -1,13 +1,13 @@
function __fish_contains_opt -d "Checks if a specific option has been given in the current commandline"
- set -l next_short
+ set -l next_short
set -l short_opt
- set -l long_opt
+ set -l long_opt
for i in $argv
- if test $next_short
- set next_short
+ if test $next_short
+ set next_short
set short_opt $short_opt $i
else
switch $i
@@ -32,7 +32,7 @@ function __fish_contains_opt -d "Checks if a specific option has been given in t
if commandline -cpo | sgrep -- "^-"$i"\|^-[^-]*"$i >/dev/null
return 0
end
-
+
if commandline -ct | sgrep -- "^-"$i"\|^-[^-]*"$i >/dev/null
return 0
end
diff --git a/share/functions/__fish_crux_packages.fish b/share/functions/__fish_crux_packages.fish
index 8cd88f4a..fa96e480 100644
--- a/share/functions/__fish_crux_packages.fish
+++ b/share/functions/__fish_crux_packages.fish
@@ -1,4 +1,4 @@
-# a function to obtain a list of installed packages with CRUX pkgutils
+# a function to obtain a list of installed packages with CRUX pkgutils
function __fish_crux_packages -d 'Obtain a list of installed packages'
pkginfo -i|cut -d' ' -f1
end
diff --git a/share/functions/__fish_gnu_complete.fish b/share/functions/__fish_gnu_complete.fish
index 47885845..ae800940 100644
--- a/share/functions/__fish_gnu_complete.fish
+++ b/share/functions/__fish_gnu_complete.fish
@@ -6,7 +6,7 @@ function __fish_gnu_complete -d "Wrapper for the complete builtin. Skips the lon
# Check if we are using a gnu system
for i in $argv
switch $i
-
+
case -g --is-gnu
set is_gnu 1
@@ -31,7 +31,7 @@ function __fish_gnu_complete -d "Wrapper for the complete builtin. Skips the lon
continue
end
-
+
switch $i
case -l --long
@@ -45,7 +45,7 @@ function __fish_gnu_complete -d "Wrapper for the complete builtin. Skips the lon
set argv $argv_out
end
-
+
complete $argv
end
diff --git a/share/functions/__fish_move_last.fish b/share/functions/__fish_move_last.fish
index b4a70f8c..c1d06043 100644
--- a/share/functions/__fish_move_last.fish
+++ b/share/functions/__fish_move_last.fish
@@ -14,14 +14,14 @@ function __fish_move_last -d "Move the last element of a directory history from
set -g (echo $dest) $$dest (command pwd)
set ssrc $$src
-
+
# Change dir to the last entry in the source dir-hist
builtin cd $ssrc[$size_src]
- # Keep all but the last from the source dir-hist
+ # Keep all but the last from the source dir-hist
set -e (echo $src)\[$size_src]
# All ok, return success
return 0
-end
+end
diff --git a/share/functions/__fish_no_arguments.fish b/share/functions/__fish_no_arguments.fish
index e47a4272..b2ce2781 100644
--- a/share/functions/__fish_no_arguments.fish
+++ b/share/functions/__fish_no_arguments.fish
@@ -5,7 +5,7 @@ function __fish_no_arguments -d "Internal fish function"
for i in $cmd
switch $i
case '-*'
-
+
case '*'
return 1
end
diff --git a/share/functions/__fish_not_contain_opt.fish b/share/functions/__fish_not_contain_opt.fish
index 0a7e0f56..8320607f 100644
--- a/share/functions/__fish_not_contain_opt.fish
+++ b/share/functions/__fish_not_contain_opt.fish
@@ -1,12 +1,12 @@
function __fish_not_contain_opt -d "Checks that a specific option is not in the current commandline"
- set -l next_short
+ set -l next_short
set -l short_opt
- set -l long_opt
+ set -l long_opt
for i in $argv
- if test $next_short
- set next_short
+ if test $next_short
+ set next_short
set short_opt $short_opt $i
else
switch $i
@@ -31,7 +31,7 @@ function __fish_not_contain_opt -d "Checks that a specific option is not in the
if commandline -cpo | sgrep -- "^-"$i"\|^-[^-]*"$i >/dev/null
return 1
end
-
+
if commandline -ct | sgrep -- "^-"$i"\|^-[^-]*"$i >/dev/null
return 1
end
diff --git a/share/functions/__fish_paginate.fish b/share/functions/__fish_paginate.fish
index 992993b6..01708f9c 100644
--- a/share/functions/__fish_paginate.fish
+++ b/share/functions/__fish_paginate.fish
@@ -6,7 +6,7 @@ function __fish_paginate -d "Paginate the current command using the users defaul
end
if commandline -j|grep -v "$cmd *\$" >/dev/null
-
+
commandline -aj "|$cmd;"
end
diff --git a/share/functions/__fish_print_filesystems.fish b/share/functions/__fish_print_filesystems.fish
index 0eeea3c8..d7222f83 100644
--- a/share/functions/__fish_print_filesystems.fish
+++ b/share/functions/__fish_print_filesystems.fish
@@ -1,8 +1,8 @@
function __fish_print_filesystems -d "Print a list of all known filesystem types"
- set -l fs adfs affs autofs coda coherent cramfs devpts efs ext ext2 ext3
- set fs $fs hfs hpfs iso9660 jfs minix msdos ncpfs nfs ntfs proc qnx4 ramfs
+ set -l fs adfs affs autofs coda coherent cramfs devpts efs ext ext2 ext3
+ set fs $fs hfs hpfs iso9660 jfs minix msdos ncpfs nfs ntfs proc qnx4 ramfs
set fs $fs reiserfs romfs smbfs sysv tmpfs udf ufs umsdos vfat xenix xfs xiafs
- printf "%s\n" $fs
+ printf "%s\n" $fs
end
diff --git a/share/functions/__fish_print_help.fish b/share/functions/__fish_print_help.fish
index f6022a57..b213c881 100644
--- a/share/functions/__fish_print_help.fish
+++ b/share/functions/__fish_print_help.fish
@@ -20,7 +20,7 @@ function __fish_print_help --description "Print help message for the specified f
set -l cmd3 s/.\x08'\(.\)'/(set_color --bold)\\1(set_color normal)/g
# Combine all expressions in a single variable
- set -l sed_cmd -e $cmd1 -e $cmd2 -e $cmd3
+ set -l sed_cmd -e $cmd1 -e $cmd2 -e $cmd3
# Render help output, save output into the variable 'help'
set -l help (nroff -man $__fish_datadir/man/$item.1)
diff --git a/share/functions/__fish_print_packages.fish b/share/functions/__fish_print_packages.fish
index fb24ffff..8dae87b9 100644
--- a/share/functions/__fish_print_packages.fish
+++ b/share/functions/__fish_print_packages.fish
@@ -25,12 +25,12 @@ function __fish_print_packages
# Rpm is too slow for this job, so we set it up to do completions
# as a background job and cache the results.
- if type -f rpm >/dev/null
+ if type -f rpm >/dev/null
# If the cache is less than five minutes old, we do not recalculate it
set cache_file /tmp/.rpm-cache.$USER
- if test -f $cache_file
+ if test -f $cache_file
cat $cache_file
set age (math (date +%s) - (stat -c '%Y' $cache_file))
set max_age 250
@@ -43,8 +43,8 @@ function __fish_print_packages
rpm -qa >$cache_file |sed -e 's/-[^-]*-[^-]*$//' | sed -e 's/$/'\t$package'/' &
end
- # This completes the package name from the portage tree.
- # True for installing new packages. Function for printing
+ # This completes the package name from the portage tree.
+ # True for installing new packages. Function for printing
# installed on the system packages is in completions/emerge.fish
if type -f emerge >/dev/null
emerge -s \^(commandline -tc) |sgrep "^*" |cut -d\ -f3 |cut -d/ -f2
diff --git a/share/functions/__fish_prt_use_package.fish b/share/functions/__fish_prt_use_package.fish
index edb2e7f7..b7c48034 100644
--- a/share/functions/__fish_prt_use_package.fish
+++ b/share/functions/__fish_prt_use_package.fish
@@ -1,7 +1,7 @@
# a function to verify if prt-get should have packages as potential completion
function __fish_prt_use_package -d 'Test if prt-get should have packages as potential completion'
for i in (commandline -opc)
- if contains -- $i update remove lock unlock current
+ if contains -- $i update remove lock unlock current
return 0
end
end
diff --git a/share/functions/cd.fish b/share/functions/cd.fish
index 64ac705d..8faa469d 100644
--- a/share/functions/cd.fish
+++ b/share/functions/cd.fish
@@ -21,7 +21,7 @@ function cd --description "Change directory"
end
return $status
end
-
+
builtin cd $argv[1]
set -l cd_status $status
diff --git a/share/functions/dirh.fish b/share/functions/dirh.fish
index 411a2816..58201767 100644
--- a/share/functions/dirh.fish
+++ b/share/functions/dirh.fish
@@ -1,5 +1,5 @@
-function dirh --description "Print the current directory history (the back- and fwd- lists)"
+function dirh --description "Print the current directory history (the back- and fwd- lists)"
if count $argv >/dev/null
switch $argv[1]
@@ -25,7 +25,7 @@ function dirh --description "Print the current directory history (the back- and
set_color $fish_color_history_current
echo -n -e $current$separator
set_color normal
-
+
for i in (seq (echo (count $dirnext)) -1 1)
echo -n -e $dirnext[$i]$separator
end
diff --git a/share/functions/down-or-search.fish b/share/functions/down-or-search.fish
index c9e8b256..3f775bfb 100644
--- a/share/functions/down-or-search.fish
+++ b/share/functions/down-or-search.fish
@@ -6,7 +6,7 @@ function down-or-search -d "Depending on cursor position and current mode, eithe
end
# We are not already in search mode.
- # If we are on the bottom line, start search mode,
+ # If we are on the bottom line, start search mode,
# otherwise move down
set lineno (commandline -L)
set line_count (commandline|wc -l)
@@ -14,7 +14,7 @@ function down-or-search -d "Depending on cursor position and current mode, eithe
switch $lineno
case $line_count
commandline -f history-search-forward
-
+
case '*'
commandline -f down-line
end
diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish
index 60fefc3b..f8e1edf4 100644
--- a/share/functions/fish_default_key_bindings.fish
+++ b/share/functions/fish_default_key_bindings.fish
@@ -3,7 +3,7 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
# Clear earlier bindings, if any
bind --erase --all
-
+
# This is the default binding, i.e. the one used if no other binding matches
bind "" self-insert
@@ -12,28 +12,28 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
bind \ck kill-line
bind \cy yank
bind \t complete
-
+
bind \e\n "commandline -i \n"
-
+
bind \e\[A up-or-search
bind \e\[B down-or-search
bind -k down down-or-search
bind -k up up-or-search
-
+
bind \e\[C forward-char
bind \e\[D backward-char
bind -k right forward-char
bind -k left backward-char
-
+
bind -k dc delete-char
bind -k backspace backward-delete-char
bind \x7f backward-delete-char
-
+
bind \e\[H beginning-of-line
bind \e\[F end-of-line
bind -k home beginning-of-line
bind -k end end-of-line
-
+
bind \e\eOC nextd-or-forward-word
bind \e\eOD prevd-or-backward-word
bind \e\e\[C nextd-or-forward-word
@@ -43,8 +43,8 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
bind \e\[3C nextd-or-forward-word
bind \e\[3D prevd-or-backward-word
bind \e\[1\;3C nextd-or-forward-word
- bind \e\[1\;3D prevd-or-backward-word
-
+ bind \e\[1\;3D prevd-or-backward-word
+
bind \e\eOA history-token-search-backward
bind \e\eOB history-token-search-forward
bind \e\e\[A history-token-search-backward
@@ -55,7 +55,7 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
bind \e\[3B history-token-search-forward
bind \e\[1\;3A history-token-search-backward
bind \e\[1\;3B history-token-search-forward
-
+
bind \ca beginning-of-line
bind \ce end-of-line
bind \ey yank-pop
@@ -73,17 +73,17 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
bind -k npage end-of-history
bind \e\< beginning-of-buffer
bind \e\> end-of-buffer
-
+
bind \el __fish_list_current_token
bind \ew 'set tok (commandline -pt); if test $tok[1]; whatis $tok[1]; commandline -f repaint; end'
bind \cl 'clear; commandline -f repaint'
bind \cc 'commandline ""'
bind \cu backward-kill-line
bind \ed kill-word
- bind \cw backward-kill-word
+ bind \cw backward-kill-word
bind \ed 'if test -z (commandline); dirh; commandline -f repaint; else; commandline -f kill-word; end'
bind \cd delete-or-exit
-
+
# This will make sure the output of the current command is paged using the less pager when you press Meta-p
bind \ep '__fish_paginate'
diff --git a/share/functions/funced.fish b/share/functions/funced.fish
index dca73d70..5bd54acd 100644
--- a/share/functions/funced.fish
+++ b/share/functions/funced.fish
@@ -14,22 +14,22 @@ function funced --description "Edit function definition"
case '*'
set -l init ''
set -l tmp
-
+
# Shadow IFS here to avoid array splitting in command substitution
- set -l IFS
+ set -l IFS
if functions -q $argv
set init (functions $argv | fish_indent --no-indent)
else
set init function $argv\nend
end
-
+
set -l prompt 'printf "%s%s%s> " (set_color green) '$argv' (set_color normal)'
# Unshadow IFS since the fish_title breaks otherwise
set -e IFS
if read -p $prompt -c "$init" -s cmd
# Shadow IFS _again_ to avoid array splitting in command substitution
- set -l IFS
+ set -l IFS
eval (echo -n $cmd | fish_indent)
end
return 0
diff --git a/share/functions/grep.fish b/share/functions/grep.fish
index 60e83b20..b0dc9586 100644
--- a/share/functions/grep.fish
+++ b/share/functions/grep.fish
@@ -3,10 +3,10 @@
#
if command grep --color=auto --help 1>/dev/null 2>/dev/null
- if not set -q GREP_COLOR
+ if not set -q GREP_COLOR
set -gx GREP_COLOR '97;45'
end
- if not set -q GREP_OPTIONS
+ if not set -q GREP_OPTIONS
set -gx GREP_OPTIONS --color=auto
end
end
diff --git a/share/functions/help.fish b/share/functions/help.fish
index 0234757f..bd536002 100644
--- a/share/functions/help.fish
+++ b/share/functions/help.fish
@@ -14,9 +14,9 @@ function help --description "Show help for the fish shell"
set -l fish_browser_bg
set -l h syntax completion editor job-control todo bugs history killring help
- set h $h color prompt title variables builtin-overview changes expand
- set h $h expand-variable expand-home expand-brace expand-wildcard
- set -l help_topics $h expand-command-substitution expand-process
+ set h $h color prompt title variables builtin-overview changes expand
+ set h $h expand-variable expand-home expand-brace expand-wildcard
+ set -l help_topics $h expand-command-substitution expand-process
# 'help -h' should launch 'help help'
if count $argv >/dev/null
diff --git a/share/functions/isatty.fish b/share/functions/isatty.fish
index 1603972f..d4f2c43e 100644
--- a/share/functions/isatty.fish
+++ b/share/functions/isatty.fish
@@ -1,7 +1,7 @@
function isatty -d "Tests if a file descriptor is a tty"
set -l fd 0
- if count $argv >/dev/null
+ if count $argv >/dev/null
switch $argv[1]
case -h --h --he --hel --help
@@ -19,7 +19,7 @@ function isatty -d "Tests if a file descriptor is a tty"
case '*'
set fd $argv[1]
-
+
end
end
diff --git a/share/functions/math.fish b/share/functions/math.fish
index f2579381..bad349d9 100644
--- a/share/functions/math.fish
+++ b/share/functions/math.fish
@@ -16,6 +16,6 @@ function math --description "Perform math calculations in bc"
return 0
end
return 2
-
+
end
diff --git a/share/functions/nextd.fish b/share/functions/nextd.fish
index 9b65b756..80d7c42a 100644
--- a/share/functions/nextd.fish
+++ b/share/functions/nextd.fish
@@ -10,7 +10,7 @@ function nextd --description "Move forward in the directory history"
end
# Parse arguments
- set -l show_hist 0
+ set -l show_hist 0
set -l times 1
for i in (seq (count $argv))
switch $argv[$i]
@@ -56,4 +56,4 @@ function nextd --description "Move forward in the directory history"
# All done
return $code
-end
+end
diff --git a/share/functions/prevd.fish b/share/functions/prevd.fish
index d0f546a2..c0361e1f 100644
--- a/share/functions/prevd.fish
+++ b/share/functions/prevd.fish
@@ -10,7 +10,7 @@ function prevd --description "Move back in the directory history"
end
# Parse arguments
- set -l show_hist 0
+ set -l show_hist 0
set -l times 1
for i in (seq (count $argv))
switch $argv[$i]
@@ -56,5 +56,5 @@ function prevd --description "Move back in the directory history"
# All done
return $code
-end
+end
diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish
index 46b4935a..7f892c70 100644
--- a/share/functions/prompt_pwd.fish
+++ b/share/functions/prompt_pwd.fish
@@ -10,7 +10,7 @@ if test (uname) = Darwin
end
else
function prompt_pwd --description "Print the current working directory, shortend to fit the prompt"
- switch "$PWD"
+ switch "$PWD"
case "$HOME"
echo '~'
diff --git a/share/functions/psub.fish b/share/functions/psub.fish
index 9eebd13b..874d5832 100644
--- a/share/functions/psub.fish
+++ b/share/functions/psub.fish
@@ -9,7 +9,7 @@ function psub --description "Read from stdin into a file and output the filename
set -l longopt -l help,file
if getopt -T >/dev/null
- set longopt
+ set longopt
end
if not getopt -n psub -Q $shortopt $longopt -- $argv
@@ -57,7 +57,7 @@ function psub --description "Read from stdin into a file and output the filename
# Write output to pipe. This needs to be done in the background so
# that the command substitution exits without needing to wait for
# all the commands to exit
- mkfifo $filename
+ mkfifo $filename
cat >$filename &
else
cat >$filename
@@ -75,6 +75,6 @@ function psub --description "Read from stdin into a file and output the filename
end
# Make sure we erase file when caller exits
- eval function $funcname --on-job-exit caller\; command rm $filename\; functions -e $funcname\; end
+ eval function $funcname --on-job-exit caller\; command rm $filename\; functions -e $funcname\; end
end
diff --git a/share/functions/pwd.fish b/share/functions/pwd.fish
index d51fe5c6..22745406 100644
--- a/share/functions/pwd.fish
+++ b/share/functions/pwd.fish
@@ -3,7 +3,7 @@
# Also drop '/private' directories on OS X.
#
-switch (uname)
+switch (uname)
case Darwin
function pwd --description "Print working directory"
diff --git a/share/functions/trap.fish b/share/functions/trap.fish
index ee29aa78..514dc976 100644
--- a/share/functions/trap.fish
+++ b/share/functions/trap.fish
@@ -13,18 +13,18 @@ function __trap_switch
switch $argv[1]
case EXIT
echo --on-exit %self
-
+
case '*'
echo --on-signal $argv[1]
- end
+ end
end
function trap -d 'Perform an action when the shell recives a signal'
set -l mode
- set -l cmd
- set -l sig
+ set -l cmd
+ set -l sig
set -l shortopt
set -l longopt
@@ -47,13 +47,13 @@ function trap -d 'Perform an action when the shell recives a signal'
case -h --help
__fish_print_help trap
return 0
-
+
case -p --print
set mode print
-
+
case -l --list-signals
set mode list
-
+
case --
set -e opt[1]
break
@@ -87,7 +87,7 @@ function trap -d 'Perform an action when the shell recives a signal'
for i in $opt
set sig (__trap_translate_signal $i)
if test $sig
- functions -e __trap_handler_$sig
+ functions -e __trap_handler_$sig
end
end
@@ -108,7 +108,7 @@ function trap -d 'Perform an action when the shell recives a signal'
end
case print
- set -l names
+ set -l names
if count $opt >/dev/null
set names $opt
@@ -130,7 +130,7 @@ function trap -d 'Perform an action when the shell recives a signal'
case list
kill -l
-
+
end
end
diff --git a/share/functions/type.fish b/share/functions/type.fish
index a9b1bdff..66b72ae3 100644
--- a/share/functions/type.fish
+++ b/share/functions/type.fish
@@ -28,14 +28,14 @@ function type --description "Print the type of a command"
switch $i
case -t --type
set mode type
-
+
case -p --path
set mode path
-
- case -P --force-path
+
+ case -P --force-path
set mode path
set selection files
-
+
case -a --all
set selection multi
@@ -54,7 +54,7 @@ function type --description "Print the type of a command"
# Check all possible types for the remaining arguments
for i in $argv
-
+
switch $i
case '-*'
continue
diff --git a/share/functions/umask.fish b/share/functions/umask.fish
index 319ce9ac..d6e0bdde 100644
--- a/share/functions/umask.fish
+++ b/share/functions/umask.fish
@@ -4,7 +4,7 @@ function __fish_umask_parse -d "Internal umask function"
if echo $argv | sgrep -E '^(0|)[0-7]{1,3}$' >/dev/null
set -l char_count (echo $argv| wc -c)
for i in (seq (math 5 - $char_count)); set argv 0$argv; end
- echo $argv
+ echo $argv
else
# Test if argument really is a valid symbolic mask
if not echo $argv | sgrep -E '^(((u|g|o|a|)(=|\+|-)|)(r|w|x)*)(,(((u|g|o|a|)(=|\+|-)|)(r|w|x)*))*$' >/dev/null
@@ -26,7 +26,7 @@ function __fish_umask_parse -d "Internal umask function"
set -l char_count (echo $tmp|cut -c 1)
set res[$i] (math 7 - $char_count)
end
-
+
set -l el (echo $argv|tr , \n)
for i in $el
switch $i
@@ -54,15 +54,15 @@ function __fish_umask_parse -d "Internal umask function"
switch $i
case '=*'
set mode set
- set i (echo $i| cut -c 2-)
+ set i (echo $i| cut -c 2-)
case '+*'
set mode add
- set i (echo $i| cut -c 2-)
+ set i (echo $i| cut -c 2-)
case '-*'
set mode remove
- set i (echo $i| cut -c 2-)
+ set i (echo $i| cut -c 2-)
case '*'
if not count $implicit_all >/dev/null
@@ -120,7 +120,7 @@ function __fish_umask_print_symbolic
if contains $val 0 1 2 3
set res {$res}r
end
-
+
if contains $val 0 1 4 5
set res {$res}w
end
@@ -161,7 +161,7 @@ function umask --description "Set default file permission mask"
return 0
case -p --as-command
- set as_command 1
+ set as_command 1
case -S --symbolic
set symbolic 1
diff --git a/share/functions/up-or-search.fish b/share/functions/up-or-search.fish
index 18c37e83..fc51d710 100644
--- a/share/functions/up-or-search.fish
+++ b/share/functions/up-or-search.fish
@@ -6,14 +6,14 @@ function up-or-search -d "Depending on cursor position and current mode, either
end
# We are not already in search mode.
- # If we are on the top line, start search mode,
+ # If we are on the top line, start search mode,
# otherwise move up
set lineno (commandline -L)
switch $lineno
case 1
commandline -f history-search-backward
-
+
case '*'
commandline -f up-line
end