Vim feature suggestion

classic Classic list List threaded Threaded
3 messages Options
enk
Reply | Threaded
Open this post in threaded view
|

Vim feature suggestion

enk

Hi,
i just had an idea:

vaB selects the current Block and another aB expands the selection to
the Block containing the first Block. The same for HTML/XML: vatat (ad
libitum)

Why not allow counts: [operator][count][a or i][object] ?

That way, you wouldn't need visual mode for these operations, which
would be more effective and pure.

Kind regards,
Erik

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

Reply | Threaded
Open this post in threaded view
|

Re: Vim feature suggestion

Tim Chase

> vaB selects the current Block and another aB expands the selection to
> the Block containing the first Block. The same for HTML/XML: vatat (ad
> libitum)
>
> Why not allow counts: [operator][count][a or i][object] ?
>
> That way, you wouldn't need visual mode for these operations, which
> would be more effective and pure.

Um...have you tried it? :)

I just created a block like this:

   { one
     { two
       { three
         { four
         }
       }
     }
   }

and then, with the cursor on the "four" line, typed

   >3aB

and correctly it indented the "{ two ...}" block as you describe
wanting :)

Same worked for <tag>s:

   <tag> one
     <tag> two
       <tag> three
         <tag> four
         </tag>
       </tag>
     </tag>
   </tag>

with the cursor on the "four" line, using

   <3at

worked as expected.  The help on both text objects indicate that
both accept a count:

   :help at
   :help aB

Vim borrows Python's time-machine[1] to add the feature you want
before you need it. ;-)

-tim

[1]
http://www.google.com/search?q="Guido's+time+machine"+python



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

enk
Reply | Threaded
Open this post in threaded view
|

Re: Vim feature suggestion

enk

On Wed, Jun 3, 2009 at 16:52, Tim Chase<[hidden email]> wrote:

>
>> vaB selects the current Block and another aB expands the selection to
>> the Block containing the first Block. The same for HTML/XML: vatat (ad
>> libitum)
>>
>> Why not allow counts: [operator][count][a or i][object] ?
>>
>> That way, you wouldn't need visual mode for these operations, which
>> would be more effective and pure.
>
> Um...have you tried it? :)

Damn, I swear I tried it :-)

It works very well. Dunno what I did wrong :-/

Thanks!

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