6 ms·
Despite decades of vi use, I'm ashamed to say I didn't know what cf" was. cf" : change(c) forward(f) to double-quote(")
by woodchuck64 14y ago
Despite decades of vi use, I'm ashamed to say I didn't know what cf" was.
cf" : change(c) forward(f) to double-quote(")
- dhimes 14y agoand ct" will change everything up to the double quote. Great stuff.
- ehamberg 14y agoLook up text objects such as i" and a". They're great. E.g: - ci" (change inner double quote) will change (delete and put you in insert mode) the text between to double quotes. - ca" (change _a_ double quote) will change the text and the surrounding double quotes. There are text objects for quotes, brackets, sentences, blocks, etc. There are also plugins that create text objects such as arguments (to functions) in programming languages.
- selectnull 14y agoI remember the time I learned that one, it was great. To save you the time, I will tell you even mightier incantation: ct" Changes Till "
- sea6ear 14y agoI wish Emacs this ability by default. I know it has zap-to-char but that works like cf" not ct". Of course that can be modified with a bit of elisp, but I wish it provided it out of the box.
- powerslave12r 14y agoSomething I have hanging next to my monitor Vim Quick reference: http://www.digilife.be/quickreferences/QRC/vi%20Quick%20Reference.pdf http://www.digilife.be/quickreferences/QRC/vi%20Quick%20Refe... [pdf]
- hboon 14y agoYou'll probably be instead in these few too: ct" c% c/something
- weaksauce 14y agoThe favorite incarnation of this is ci" Change inside double quotes. Or cit, change inside html tag. (not sure if this is in vanilla vim but I think so) Replace " with any of these (,'{,[,< for other powerful commands.