I have this code:
def foo(c: Char) = c match {
case 'a': 'B'
}
My cursor is on the space after =
. I want to delete everything until, including, the }
. How can I do that?
Can I do the same where the cursor is anywhere on the first line? Anywhere in the block (and place the cursor after the =
)?
Yes, use the "till" motion. means delete until a ". There is also the "find" motion, which deletes up to and including the character.
Press ESC to go to Normal mode. Place the cursor on the line you need to delete. Press dd . This will delete the current line.
d/}/e
does the job.
d/}
deletes until the }
but adding the /e
flag moves the cursor on the last char of the match, effectively deleting everything between the cursor and the }
, inclusive.
Using visual selection works too, in a slightly more intuitive way:
v/}<CR>d
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