Andy Spencer schrieb:
>>> Nice idea, certainly useful! I'm not sure whether this should be
>>> implemented in the C code, though, as it could also be done with
>>> Vimscript.
>> It may as well be in the C code alongside all of the other text
>> objects.  Notice the cases just below his patch which are waiting to
>> be implemented.
> 
> I agree that it should be done in the same place as the rest of the text
> objects. However, I'm curious how it would be implemented in vimscript?
> I didn't know it was even possible to implement something like text
> objects in vimscript.
> 
> 
>> One suggestion: How about changing 'ii' so that it excludes empty
>> lines at the beginning and end of the buffer, similar to what the
>> other text objects do? I don't like it when outer and inner text
>> object versions are identical.
> 
> I guess consistency would be nice. I've attached an updated patch.

" these text objects are linewise

noremap <silent> aa :<C-U>norm! ggVG<CR>
noremap <silent> ii :<C-U>call InnerBuf()<CR>

nunmap aa
sunmap aa
nunmap ii
sunmap ii

func! InnerBuf()
    let line1 = nextnonblank(1)
    if line1 == 0
        " the buffer is blank, select it like with aa
        norm! ggVG
        return
    endif
    exec "norm!" line1."ggV". prevnonblank("$")."G"
endfunc


-- 
Andy


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui