On Sep 11, 7:40 am, Tim Chase <[email protected]> wrote:
>
> > Nahhh , I don't use visual mode. In any case , it's easy to create
> > a command to replicate the functionality in other modes.
>

Yikes! Text-objects are way more useful without using visual mode,
don't worry. They're also nice in visual mode but their power lies in
the fact that you don't need to resort to visual mode for complicated
changes.

> Text objects don't require you to use visual-mode.  While you can
> highlight text-objects in visual mode such as
>
>    vi"
>
> they are just elaborate motions that pair well with just about
> every other vim command.  Want to indent the contents of the
> {...} block you're inside?  Just use
>
>    >i{
>
> no visual-mode required :)
>

I think the most useful to me is the 'it' object (inner tag) and
'at' (a tag) while editing HTML.

Consider:

<p>Here is some text with a <a href=
'http://example.com'>link
which is
embedded on
a few lines</a> with some trailing text.</p>

What's the best way to change the entire link text? Try placing the
cursor anywhere within the <a> tag (including inside the <a href...
part) and typing cit. Tada! you're in insert mode inside the tag,
replacing the entire link text. How about removing the link entirely?
dat. Even better, with the surround plugin, you can cst<span
class='foo'> from anywhere inside the <a> element to change the tag
from an <a> element to a <span> element.

None of this uses visual mode. All of this would be fairly complicated
and probably take multiple steps without text objects, meaning most
likely you would be forced into visual mode for a brief period just to
avoid interrupting your "flow" to think excessively about how to
accomplish it.

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

Reply via email to