Monday, August 22, 2011

Re: :e handles one file

On 08/22/2011 04:26 PM, AK wrote:
> On 08/22/2011 05:15 PM, Tim Chase wrote:
>> function! Edit(really, ...)
>> if len(a:000)
>> for globspec in a:000
>> let l:files = split(glob(globspec), "\n")
>> for fname in l:files
>> exec 'e'.(a:really).' '.(fname)
>> endfor
>> endfor
>> else
>> exec 'e'.(a:really)
>> endif
>> endfunction
>>
>> command! -nargs=* -complete=file -bang E call Edit("<bang>",<f-args>)
>>
>> which should give you an ":E" command that works like ":e" except that
>> if you give it one or more filespecs, it loads them all and leaves you
>> on the last one.
>
> Thanks, I for one will use it. I don't see any harm if vim could do this
> with :e command though.

This was almost a cut-n-paste from one of my variants--the
original using ":badd" instead of ":e". If I want to load a file
in the current window, I use :e whereas if I wanted to stock up
the buffer list with a filespec, I used my :badd variant of this
function.

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