How to duplicate a whole line in Vim?

后端 未结 19 1038
北海茫月
北海茫月 2020-12-22 14:29

How do I duplicate a whole line in Vim in a similar way to Ctrl+D in IntelliJ IDEA/ Resharper or Ctrl+Alt+&

19条回答
  •  Happy的楠姐
    2020-12-22 15:03

    1 gotcha: when you use "p" to put the line, it puts it after the line your cursor is on, so if you want to add the line after the line you're yanking, don't move the cursor down a line before putting the new line.

提交回复
热议问题