Quantcast
Channel: What is the difference between s, c and r commands in vi/vim? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by Joey for What is the difference between s, c and r commands in vi/vim?

$
0
0

You may try these commands in visual block mode (press <C-v> to enter), they act a little different.

When you select a block of characters and then type s, it will immediately remove the block and enter insert mode, whatever you input next will be inserted in the same position on each of the lines affected by the visual block selection.

Command c basically does the same thing.

What interesting is command r, when you type ra after you select a block, it will replace every character in that block to a instead of just leave one column of a. I think this can be very useful at some point.


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images