News for hackers. Stuff that matters.
Re:Everyone Who Tried to Convince Me to Use Vim Was Wrong by dtf on Thursday July 29, 2010 @05:58AM (#1557089)
For the eight years I've been using vim, I have never known about ci". I feel both stupid and in awe.
Re:Everyone Who Tried to Convince Me to Use Vim Was Wrong by telemachos on Thursday July 29, 2010 @07:03AM (#1557190)
'i' and 'a' (mnemonic: the 'a' grabs all of something (and its white space) as opposed to 'i' which grabs the inner part) as modifiers for 'c', 'd', 'y', and 'v' can be very useful, but I don't see them talked about much in most tutorials.

See :help motion.txt - they're in section 6. Text Object Selection. Also, just play around with them a little. For example:

   <p>This is a tes|t. Do not be alarmed.</p>
If that's your text, and the cursor is at the pipe:

    ciw  # remove all of 'test', enter insert mode
    caw  # remove the word 'test' and preceding space, enter insert mode
    vit  # visually select all the text within the <p> tags
    vat  # visually select the whole <p> element
Re:Everyone Who Tried to Convince Me to Use Vim Was Wrong by llimllib on Thursday July 29, 2010 @09:11AM (#1557421)
and diw and daw delete the whole word, gUiw uppercases the whole word, and ...

The composability of vim motion commands is what keeps me using it.

Re:Everyone Who Tried to Convince Me to Use Vim Was Wrong by _pi on Thursday July 29, 2010 @10:06AM (#1557581)
Hmm for some reason my motions don't work with [ { ( or b/B. I can't seem to find a reason for this. " works though.

Edit: seems actual jump selection can be finicky.

Re:Everyone Who Tried to Convince Me to Use Vim Was Wrong by rimantas on Thursday July 29, 2010 @09:25AM (#1557454)
Check out this: http://blog.interlinked.org/tutorials/vim_tutorial.html (text-objects section in particular).
Re:Everyone Who Tried to Convince Me to Use Vim Was Wrong by stevelosh on Thursday July 29, 2010 @08:25AM (#1557328)
You can use other characters too: like ', {, [, (, t (HTML tag).

Even better, you can use b instead of ( and B instead of {, because it's easier to type.

Re:Everyone Who Tried to Convince Me to Use Vim Was Wrong by baq on Thursday July 29, 2010 @01:42PM (#1558413)
same here, though i quite religiously use df" and d%.