Question

is there a keystroke to replace a region (series of characters, whatever) with a another character (for example whitespace)? I am not searching for c, because it deletes the existing characters and lets me enter new ones, which may be less or more characters. I want to replace exactly the deleted characters with another char as with R.

For example I have this:

one two three four

and want to replace it with:

one two ----- four

If the cursor is on the beginning of three, I'd like to enter a keystroke, a region (for a example w for end-of-word) and a replacing char (in this case -) to let vim replace all characters in that region with the given replacing char.

Was it helpful?

Solution

you could try:

ver-

to replace selected part with -

same, if you want to replace / fill the "region" with space, you do:

verspace

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top