diff --git a/templates/fish.fish b/templates/fish.fish index f55efea..4bc1915 100644 --- a/templates/fish.fish +++ b/templates/fish.fish @@ -15,11 +15,12 @@ function {{ lacy_cmd }} end end function __{{ lacy_cmd }}_autocomplete - set args $argv - if test "$args" = "" + set query (string split " " (commandline -c)) + set query (string join " " $query[2..-1]) + if test "$query" = "" ls -D --icons=never -1 else - set dirs (string split ' ' (lacy complete -- "$args")) + set dirs (string split ' ' (lacy complete -- "$query")) for dir in $dirs basename $dir end @@ -27,4 +28,4 @@ function __{{ lacy_cmd }}_autocomplete end complete --no-files lacy -x -a "prompt complete init help" complete --no-files {{ lacy_cmd }} -r -a "(__{{ lacy_cmd }}_autocomplete)" -# END generated Lacy shell config \ No newline at end of file +# END generated Lacy shell config