Cut and paste multiple lines in vim

前端 未结 5 1325
旧时难觅i
旧时难觅i 2021-01-30 03:03

I\'m running vim 7.3 on a Mac 10.7.2 and I\'m having some trouble cutting and pasting several lines.

On my old Linux setup (which was stolen so I don\'t know versions)

5条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 03:33

    To cut and paste by line numbers (do :set number to see the line numbers), for lines x to y do:

    :x,yd
    

    or if your cursor is already on line x, do

    :,yd
    

    Then go to where you want to paste and press p

提交回复
热议问题