Monday, August 22, 2011

Re: :e handles one file

On 08/22/2011 12:09 PM, Tom wrote:
> I know :args can load multiple files in multiple buffers but why would
> you explicitly make :e only handle one, then complain if there's more
> then one argument and create other commands to do what you're trying
> to prevent with the first command? That seems a bit illogical...
>
> Would it be a good idea to have vim handle multiple files with :e in
> the future, and if not why?

Because :e replaces the contents of the current window with the
contents of the specified file, asking for multiple files makes
for an undefined result: should the first file be put in the
current window, and the other files added to the args? Should the
first file be put in the current window, and the other files
split into other windows? How about each in its own tab? Should
the last file in the resulting filespec override the others (as
if ":e f[12].txt" did the same thing as ":e f1.txt" followed by
":e f2.txt")?

So I can see clear reasons for not letting ":e" take a file-glob.
However the two that do surprise me are that :badd and
:split/:vsplit don't let you specify a file-glob. There have
been plenty of times I'd like to issue something like

:sp att*.txt

to open each "att*.txt" file in its own split window. I've seen
(as well as built) some simple functions/commands to assist in
doing that, but those seem less constrained than ":e" and thus
better candidates for accepting a glob, IMHO.

-tim


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: