Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

feature request: special completion of glob patterns



This one's a little bit tricky to explain, and I suspect way too
tricky to implement, but I'll mention it anyway.

Say I want to diff two files in mirrored directory hierarchies:

   foo1/bar/baz.txt
   foo2/bar/baz.txt

Ideally, I would like the following completion behaviour (assuming
baz.txt is the only file in foo1/bar):

  $ diff -u foo[12]/bar/b<TAB>
  $ diff -u foo[12]/bar/baz.txt

i.e. zsh would do normal expansion on `foo[12]/bar/b', attempt
completion on the first filename generated by the expansion, and then
perform the same change to `foo[12]/bar/b' as it did to `foo1/bar/b'
when it completed it to `foo1/bar/baz.txt', which in this case is
adding `az.txt' to the end.

Similar behaviour for

  $ diff -u foo_{one,two}/bar/b<TAB>

would be great too.

Now I realise that to do this in full generality with the myriad of
complex patterns zsh understands may well be impossible, but is it
feasible to deal with simple cases like these?



Messages sorted by: Reverse Date, Date, Thread, Author