fish/share/functions/__fish_list_current_token.fish
liljencrantz 65d223e672 Make sure all keybinding scripts repaint properly
darcs-hash:20070921151723-75c98-83f2fe86ace0f6e567db26faa4d94665971af145.gz
2007-09-22 01:17:23 +10:00

22 lines
455 B
Fish

#
# This function is bound to Alt-L, it is used to list the contents of
# the directory under the cursor
#
function __fish_list_current_token -d "List contents of token under the cursor if it is a directory, otherwise list the contents of the current directory"
set val (eval echo (commandline -t))
if test -d $val
ls $val
else
set dir (dirname $val)
if test $dir != . -a -d $dir
ls $dir
else
ls
end
end
commandline -f repaint
end