Gary Johnson wrote:
> On 2009-09-12, Daniel Fetchinson wrote:
>> Hi vimmers,
>>
>> I'm regularly doing :split filename1 followed by :split filename2
>> followed by :split filename3 and was trying to do :split filename* but
>> this didn't work. The goal would be to split the window in as many
>> pieces as the number of files that match filename* and have each of
>> the matching files in it's own split window.
>>
>> Basically I'm trying to automate :split filename1 :split filename2
>> :split filename3 etc etc.
>>
>> Is there a way to do this?
>
> You can do
>
> :args filename*
or if you want to keep your current args, you can use :argadd
instead.
> to set the argument list to that set of files, then
>
> :all
>
> to open each file in the argument list in a new window.
alternatively you can use
command! -nargs=1 Sp for fname in split(glob("<args>"),
'\n')<bar> exec 'sp '.escape(fname, ' \\')<bar> endfor
to define a Sp command:
:Sp *.txt
-tim
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---