11

Is there a shortcut for 10k10dd? I want to delete the 10 lines prior to the cursor, without having to move the cursor backwards first.

Natan Yellin
  • 6,063
  • 5
  • 38
  • 57

3 Answers3

21

Did you try something like d10k ?

cnicutar
  • 178,505
  • 25
  • 365
  • 392
2

In certain circumstances, those 10 lines are the beginning of a paragraph than you can delete with:

  • d{

or the beginning of a ( C-like) function

  • d[[

See :help object-motions for more details and ideas.

It is usually easier to use text objects than to count lines. ( Well on Vim latest versions, you can use set rnu to avoid manually counting backward or forward lines.)

Xavier T.
  • 40,509
  • 10
  • 68
  • 97
1

You could select the lines that you want to delete in visual mode and then delete those.

Waseem
  • 8,232
  • 9
  • 43
  • 54