How to insert a block of white spaces starting at the cursor position in vi?

前端 未结 8 1586
渐次进展
渐次进展 2020-12-23 16:53

Suppose I have the piece of text below with the cursor staying at the first A currently,

AAAA
BBB
CC
D

How can I add spaces in

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-23 17:35

    I would do like Nigu. Another solution is to use :normal:

    1. to enter VISUAL-LINE mode
    2. 3j or jjj or /D to select the lines
    3. :norm I, the correct range ('<,'>) being inserted automatically

    :normal is probably a bit overkill for this specific case but sometimes you may want to perform a bunch of complex operations on a range of lines.

提交回复
热议问题