Question

The title says it all: is there a way in Vi(m) to move a line, by number, to my current line?

I could move to my source line first, then use the :m command to move that line. But that involves leaving my target line. Or, I could :Nd, but that also moves me off of my current line and on to the deleted line number N.

It's frustrating looking at a line and thinking "move here" and not knowing how :D.

Was it helpful?

Solution

:3m . moves line 3 to your current line.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top