Quantcast
Viewing latest article 5
Browse Latest Browse All 5

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

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 latest article 5
Browse Latest Browse All 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>