In Vim, what is the best way to select, delete, or comment out large portions of multi-screen text?

前端 未结 16 1215
醉话见心
醉话见心 2021-01-31 09:43

Selecting a large amount of text that extends over many screens in an IDE like Eclipse is fairly easy since you can use the mouse, but what is the best way to e.g. select and de

16条回答
  •  醉酒成梦
    2021-01-31 10:29

    If you want to perform an action on a range of lines, and you know the line numbers, you can put the range on the command line. For instance, to delete lines 20 through 200 you can do:

    :20,200d
    

    To move lines 20 through 200 to where line 300 is you can use:

    :20,200m300
    

    And so on.

提交回复
热议问题