views:

151

answers:

1

In vim (and bash), you can specify alternatives in filenames, eg:

:arga project/html/{index,sitemap}.html

This expands to "project/html/index.html" and "project/html/sitemap.html" (the :arga appends them both to the argument list; you can get to them with :n).

Now, vim already does some filename completion on this, with TAB, by cycling through the possibilities. For the above example, it would show the index one, then the sitemap one, then back to the original text.

I to be able to type this much:

:arga project/html/{in

and press TAB, and have it complete (even though I'm in the middle of a brace):

:arga project/html/{index.html

and have tab-completion also work for the next one, from project/html/{index.html,sit to project/html/{index.html,sitemap.html.

Is there already an option in vim to do this? If not, how would you implement it?

+1  A: 

If this is possible, you'll have to define your own :Arga command and to specify your own expansion function. However as vim has a few things hard-coded in regard of command-line completion, I can't guaranty you that this is possible.

You can have a look at my :SearchIn* commands for examples.

Luc Hermitte