10

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
  • 5,662
  • 4
  • 34
  • 57

3 Answers3

20

Did you try something like d10k ?

cnicutar
  • 172,020
  • 25
  • 347
  • 381
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.
  • 39,000
  • 8
  • 66
  • 95
1

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

Waseem
  • 7,898
  • 7
  • 41
  • 51