Vim: insert the same characters across multiple lines

后端 未结 12 1910
慢半拍i
慢半拍i 2020-11-29 14:23

Sometimes I want to edit a certain visual block of text across multiple lines.

For example, I would take a text that looks like this:

name
comment
ph         


        
12条回答
  •  庸人自扰
    2020-11-29 14:45

    Use Ctrl+V to enter visual block mode
    Move Up/Down to select the columns of text in the lines you want to comment.
    Then hit Shift+i and type the text you want to insert.
    Then hit Esc, wait 1 second and the inserted text will appear on every line
    

提交回复
热议问题