If you have a text like:

word1 word2
word3 word4 word5

You can put your cursor over first d, type 2D and be left with:


But you can't do the deletion upwards from second line with 2d^ or 2d0. Closest I found was 3db which removes based on number of words not lines.

Any equivalent of D command only upwards, without resorting to visual mode?

Edit: Put your cursor over w of word4. If you type 2db you end up with word1 word4 word5. If you type dv2k, you end with the same. What I want is just word4 word5.

  • @BLayer added edit, your solution is similar to db.
    – d9ngle
    Commented Aug 26, 2021 at 6:52
  • 1
    @BLayer works perfectly. Please post answer with explanation so I can upvote!
    – d9ngle
    Commented Aug 26, 2021 at 6:57

1 Answer 1


The secret weapon is v. Specifically, you can convert a command that by default operates in a linewise manner to characterwise operation by typing v after the command and before the motion, e.g. compare dk to dvk.

With that in hand we just need to identify the (normally linewise) command that, used in conjunction with v, gets the desired effect.

A good motion candidate is -...

-  <minus>      [count] lines upward, on the first non-blank
                character |linewise|.

With the cursor on the "w" of "word4" d- will delete everything on the current and preceding lines. But insert v in the middle for dv- and, voila, that will delete everything on the same line that precedes that "w" and the entirety of the preceding line.

And just FYI, you can use ctrl-v in place of v and then you'll go from linewise to blockwise operation.

  • Perfect. What's the motion candidate for forward deletion? instead of D what can I use to delete everything from cursor and next line with dv
    – d9ngle
    Commented Aug 26, 2021 at 7:09
  • Did you try +...you know, that thing that is the opposite of - ;) ... (To be fair, because of the way lines are navigated you'll need to add 2 in there: d2v+.)
    – B Layer
    Commented Aug 26, 2021 at 7:14
  • Yup, already tried. Not working as expected. Try putting cursor on w of word2, and delete everything and next line.
    – d9ngle
    Commented Aug 26, 2021 at 7:15
  • 1
    Yes, that's what I tested and it works (deletes word2 and all of following line). You need there to be an empty line below the two target lines. I'm not sure off the top of my head how to do it at the end of the file.
    – B Layer
    Commented Aug 26, 2021 at 7:16
  • 1
    What about just d}?
    – B Layer
    Commented Aug 26, 2021 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.