Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

As far as I can tell, d2d and 2dd have exactly the same effect.

I'm curious – ignoring any remappings of d and 2, are there any cases in which d2d and 2dd will produce a different result?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

No.

According to the Vim manual

[count] An optional number that may precede the command to multiply or iterate the command. If no number is given, a count of one is used, unless otherwise noted.

Both commands will always produce the same result. If there is more than one count, then each count will be multiplied together. For example 2d2d is equivalent to 4dd, and 3d3d is equivalent to 9dd.

If you're only interested in just deleting two lines, you can save yourself an extra keystroke by using dj.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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