Vim: insert the same characters across multiple lines

后端 未结 12 1909
慢半拍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:51

    1. Select the lines you want to modify using CtrlV.
    2. Press:

      • I: Insert before what's selected.
      • A: Append after what's selected.
      • c: Replace what's selected.
    3. Type the new text.

    4. Press Esc to apply the changes to all selected lines.

提交回复
热议问题