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

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

    Let's assume you want to shift a block of code:

    • setup the count of spaces used by each shift command, :set shiftwidth=1, default is 8.
    • press Ctrl+v in appropriate place and move cursor up k or down j to select some area.
    • press > to shift the block and . to repeat the action until desired position (if cursor is missed, turn back with h or b).

提交回复
热议问题