On 1/30/07, Velko Hristov <[EMAIL PROTECTED]> wrote:
> I'm glad that the next fish version is expected to pop up soon. So I
> use the opportunity to make a feature request and hope that it is not
> too difficult to implement.
>
> If I have a directory containing the files
>
> file.avi file.txt file.pdf file.tar.gz file.tar.bz2
>
> bash completes the file names based on the command I requested. So if I
> type:
>
> "mplayer [TAB]" it expands to "mplayer file.avi"
> "vi [TAB]" it expands to "vi file.txt"
> "evince [TAB]" it expands to "evince file.pdf"
> "tar xvzf [TAB]" it expands to "tar xvzf file.tar.gz"
> "tar xvjf [TAB]" it expands to "tar xvjf file.tar.bz2"
>
> Yes, even the last two work as intended. I guess they check MIME types
> and file associations but I'm not sure.
>
> It would be really cool to have in in fish too.

Fish actually has this as well. Try using file completion in e.g.
bunzip2, and fish will complete bz2 archives rather than other files
if possible. To use this, use the __fish_complete_suffix function like
this:

complete -c evince -x -a "( __fish_complete_suffix (commandline -ct)
.pdf 'PDF document')"

Fish doesn't use this a lot since when I've used this in bash, I ran
into lots of issues, like files on Windows partiotions called foo.PDF,
like bash not knowing that there are _lots_ of other container formats
than avi, qt and mpg supported by mplayer, etc. Also, some files are
just plain misnamed. The feature simply got in the way.

This shouldn't really be a problem in fish anymore, because if fish
doen't find _any_ completions, it reverts back to trying regular file
completion, even if the completion file specified that regular file
completions should not be used.

Feel free to send i updates.

>
> Regards - Velko
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Fish-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fish-users

-- 
Axel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to