Skip to main content
added 537 characters in body
Source Link
PhilippFrank
  • 1.2k
  • 9
  • 13

I can't yet comment, so I need to make a new answer. The keys d k given by Rich don't work for me even when using the nocompatible option. A reason might be that the motion k is considered linewise by vim, in which case both lines are deleted. From :help d:

An exception for the d{motion} command: If the motion is not linewise, the start and end of the motion are not in the same line, and there are only blanks before the start and after the end of the motion, the delete becomes linewise. This means that the delete also removes the line of blanks that you might expect to remain. Use the |o_v| operator to force the motion to be characterwise

It also shows the remedy: Use dvk to force the motion to be character-wise. This does the trick for me.

I didn't know o_v before, so here's :help o_v:

v

When used after an operator, before the motion command: Force the operator to work characterwise, also when the motion is linewise. If the motion was linewise, it will become |exclusive|. If the motion already was characterwise, toggle > inclusive/exclusive. This can be used to make an exclusive motion inclusive and an inclusive motion exclusive

I can't yet comment, so I need to make a new answer. The keys d k given by Rich don't work for me even when using the nocompatible option. A reason might be that the motion k is considered linewise by vim, in which case both lines are deleted. From :help d:

An exception for the d{motion} command: If the motion is not linewise, the start and end of the motion are not in the same line, and there are only blanks before the start and after the end of the motion, the delete becomes linewise. This means that the delete also removes the line of blanks that you might expect to remain. Use the |o_v| operator to force the motion to be characterwise

It also shows the remedy: Use dvk to force the motion to be character-wise. This does the trick for me.

I can't yet comment, so I need to make a new answer. The keys d k given by Rich don't work for me even when using the nocompatible option. A reason might be that the motion k is considered linewise by vim, in which case both lines are deleted. From :help d:

An exception for the d{motion} command: If the motion is not linewise, the start and end of the motion are not in the same line, and there are only blanks before the start and after the end of the motion, the delete becomes linewise. This means that the delete also removes the line of blanks that you might expect to remain. Use the |o_v| operator to force the motion to be characterwise

It also shows the remedy: Use dvk to force the motion to be character-wise. This does the trick for me.

I didn't know o_v before, so here's :help o_v:

v

When used after an operator, before the motion command: Force the operator to work characterwise, also when the motion is linewise. If the motion was linewise, it will become |exclusive|. If the motion already was characterwise, toggle > inclusive/exclusive. This can be used to make an exclusive motion inclusive and an inclusive motion exclusive

Source Link
PhilippFrank
  • 1.2k
  • 9
  • 13

I can't yet comment, so I need to make a new answer. The keys d k given by Rich don't work for me even when using the nocompatible option. A reason might be that the motion k is considered linewise by vim, in which case both lines are deleted. From :help d:

An exception for the d{motion} command: If the motion is not linewise, the start and end of the motion are not in the same line, and there are only blanks before the start and after the end of the motion, the delete becomes linewise. This means that the delete also removes the line of blanks that you might expect to remain. Use the |o_v| operator to force the motion to be characterwise

It also shows the remedy: Use dvk to force the motion to be character-wise. This does the trick for me.