I'm sure that I'm going to get ridiculed for asking a duplicate question; someone must have asked the question before! But in an hour of searching I haven't found it. I must be searching for the wrong thing.
In Vi (or Vim) I am able to delete all characters up to the } character through the key sequence dt} (or df} if I want to remove the bracket as well).
However, this only works if the } character is on the current line. What I want to do is to delete everything up to the next } even if it's first occurrence is on a subsequent line.
I'm thinking something like d/} (where the slash /}<enter> in any other context, would take me to the next occurrence of }). For obvious reasons, this doesn't work, but I hope the intention is clear.
== EDIT ==
Okay okay okay... sorry. You're all right, it does work (on my clean-install machine). might be some messed-up mapping in a config file, but it's not working on my other one.
Hang head in shame
d/}<cr> works. It's the canonical way to delete until the next } that's not on the same line. By the way, d?{<cr> does the same but in the opposite direction.
This plugin should save you some keystrokes. It extends the functionality of fFtT,; so they work across lines.
If the character is } or { placed at the beginning of the line, one way could be using Text object motions, so a command like d]] could be useful too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With