Emacs has an open-rectangle function that allows you to select a rectangular area (for example, the visual block of a Vim image), then press a key combination to fill this rectangle with spaces by clicking on any existing content on the right:


This is really useful when working with vertically aligned columns of text. It seems to me that I can also do this in Vim using the visual block + search and replace. But I cannot understand why my search and replacements are not related to my rectangle when I try it.
:'<,'>s/\^/ /
This actually discards the entire row rather than opening this selected area. I tried replacing:
:'<,'>s/\v(.*)/ \1/
But it has the same effect. How can I get my template to understand that I only want to replace each line in the selected block with spaces + selected area? Simple replacements, such as just working with letters, but using ^ or .* Does not work as I expected.
I am aware of the ability to hit βIβ and insert some spaces to return to normal mode, but itβs harder to judge when you backtrack in large numbers over many lines.
source share