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

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

    1. Ctrl + v (to enter in visual mode)
    2. Use the arrow keys to select the lines
    3. Shift + i (takes you to insert mode)
    4. Hit space keys or whatever you want to type in front of the selected lines.
    5. Save the changes (Use :w) and now you will see the changes in all the selected lines.

提交回复
热议问题