18 ms·
> d/text<enter> if you have a unique letter, as in this case ("t"), a quicker way is "dtt" (delete till "t") or "ctt" (change till "t"). in case of non uniqu
by minusf 4y ago
> d/text<enter>
if you have a unique letter, as in this case ("t"), a quicker way is "dtt" (delete till "t") or "ctt" (change till "t"). in case of non unique character it takes a count but that scales badly for me, and i use /.
- deleted 4y ago[deleted]
- cassepipe 4y agoI have to personally thank you for that one. Thank you.
- oktwtf 4y agoThese discussions are always a gold mine of tips.! Also I like to use "f" for find followed by the character you wish to move cursor to the character you desire to end up on the present line. (ex. "fl" jumps to the first "l" of the line.)
- amelius 4y agoAnd you can also type d2ft to delete everything up to and including the second t, for example. (I personally think of "f" as "find", not "first")
- oktwtf 4y agoI never even thought to numerically increment the action! What beautiful chords at this here fireside chat.
- zefhous 4y agoThere’s also the `;`, which repeats the last movement! So if you did `dft` and didn’t see the extra “t” in the way in the first place, you can then just do `d;`. It’s like `.` but for movement! I think that’s right anyway, no vim terminal at hand to check myself.
- cuddlecake 4y agoWouldn't just `.` do the same as `d;` in that case?
- amelius 4y agoNot always, the ";" sets the repetition-count of the operation to 1. You can type "d2;" however.
- cuddlecake 4y agoGood to know, thank you
- oktwtf 4y agoOh great, I’ll finally have to remove my remap of ‘; = :’ never did I investigate to know what I was opting out of.
- paledot 4y agoNot worth it. That remap has saved me more keystrokes than I can reasonably count. But adding the opposite remap for good measure isn't the worst idea.
- nyx 4y agoI think of the t motion as "to", and the f motion as "frough" (rhymes with through: "delete frough the second t").
- bch 4y agoBeautiful - the ways I’ve never considered composing…
- wyager 4y agoHow does dtt differ from dft?
- aGHz 4y agodtt will stop just before the first t character, dft will delete the t as well.
- kevincox 4y agoIn the case of dtt you can also often repeat it with . if you have a "false positive" before the intended character rather than counting occurances. Not for c but for d if you don't need the yanked text and regular movement.