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

前端 未结 8 1543
渐次进展
渐次进展 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:39

    When on the first A, I'd go in block visual mode ctrl-v, select the lines you want to modify, press I (insert mode with capital i), and apply any changes I want for the first line. Leaving visual mode esc will apply all changes on the first line to all lines.

    Probably not the most efficient on number of key-strokes, but gives you all the freedom you want before leaving visual mode. I don't like it when I have to specify by hand the line and column range in a regex command.

提交回复
热议问题