Currently, I have two similar methods to replace the entire buffer with some other text (say in clipboard).
delete all lines:
paste text: "+P ( or similar:
visually select all lines: ggVG.
paste text: "+P.
However I couldn't seem to find an one-command-fire way to do that. The most close one I found is
:change command. But it doesn't seem to work well with registers. Of course I can create some function and/or map a key to do that. But before I could make all these customizations, I want to make sure:
Is there some built-in command to replace a range of lines with some other text? Like, you could
:%replace+to replace the entire buffer with text in clipboard?