4 ms·
For the eight years I've been using vim, I have never known about ci". I feel both stupid and in awe.
by dtf 16y ago
For the eight years I've been using vim, I have never known about ci". I feel both stupid and in awe.
- telemachos 16y ago'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
- llimllib 16y agoand 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.
- _pi 16y agoHmm 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.
- stevelosh 16y agoYou 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.
- rimantas 16y agoCheck out this: http://blog.interlinked.org/tutorials/vim_tutorial.html http://blog.interlinked.org/tutorials/vim_tutorial.html (text-objects section in particular).
- baq 16y agosame here, though i quite religiously use df" and d%.