In Vim, can I move a line to current line without leaving the current line?

StackOverflow https://stackoverflow.com/questions/21915068

  •  14-10-2022
  •  | 
  •  

Domanda

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.

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top