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

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

  •  14-10-2022
  •  | 
  •  

문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top