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