Monday, May 10, 2010

Re: Open multiple files in vim

(Re-ordering replies for list convention of bottom-posting.)

> On Mon, May 10, 2010 at 5:51 PM, stosss <stosss@gmail.com> wrote:
>> On Mon, May 10, 2010 at 3:29 AM, robert song
<robertsong.japan@gmail.com> wrote:
>>> In vim, if I try to use :sp *.c to open mutiple C source files, and it
>>> will stops with "Too many file names" error.
>>>
>>> Is there any way to open multiple files in vim ?
>>
>> Read man vim
>>
>> vim -o[N]
>> vim -O[N]
>> vim -p[N]

On 05/10/2010 04:57 AM, robert song wrote:
> thanks, stosss.
> I know that it can be done with these options.
> But I mean if I can operate it after vim start.
> Like some command, :sp <files>.

Try using the :snext command (abbreviated :sn):

:sn *.c

It's like this combination of commands:

:split | next *.c

The command ":split {filename}" is like ":edit {filename}", in
that neither permits a wildcard. The command ":next {arglist}"
accepts a wildcard pattern and not just a single filename, and
":snext {arglist}" is similar but does a ":split" first.

For more information:

:help :snext
:help :next
:help :split_f

Michael Henry

--
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: