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

Completion of paths with filename generation or brace expansion involved



Hi,

Let's consider this filesystem:

/foo/bar/fish
/foo/bar/zoo
/foo/bar/zsh
/foo/baz/zsh

When I type:

$ /foo/ba{r,z}/z<tab>

then thanks to brace expansion, my buffer is replaced with:

$ /foo/bar/z /foo/baz/z

Similarly, when I type:

$ /foo/ba(r|z)/<tab>

then thanks to filename generation, my buffer is replaced with:

$ /foo/bar/ /foo/baz/

Also, if instead of <tab>, I hit <shift>+<tab>, I get a menu which
allows me to choose between possible expansions / generations and the
original expression.

What I would like to know, is if there's a way to have completion at
this point, without modifying the part of the buffer that I've already
typed. In other words, is it possible, when I type:

$ /foo/ba{r,z}/z<somekey>
$ /foo/ba(r|z)/<somekey>

to have my buffer *not* changed, but get suggestions for files that are:
1) either in /foo/bar *or* /foo/baz
2) both in /foo/bar *and* /foo/baz

?

For case 1), I'd expect the buffer to be changed to:

$ /foo/ba{r,z}/z
file
zoo zsh

after non-modifying brace expansion, or

$ /foo/ba(r|z)/
file
fish zoo zsh

after non-modifying filename generation.

For case 2), I'd expect the buffer to be changed to:

$ /foo/ba{r,z}/zsh

after non-modifying brace expansion, or
$ /foo/ba(r|z)/zsh

after non-modifying filename generation.

Any idea?

Thanks in advance!

-- 
Jérémie



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