Suppose I have an open buffer containing the following text11111111111        11 222222 11 2    2 11 2 33 2 11 2 33 2 11 2 33 2 11 2    2 11 222222 11        11111111111I can visually select and yank the 2-rectangle with the command 3gg2l<Ctrl-V>8jeyThen, I can immediately reselect and paste the yanked text (not changing thebuffer) with gvp.However, it seems like as soon as I write to the @@ or @ register (even ifI don't change the value), something changes, and pasting doesn't work rightanymore.For example, doing:let @@=@@:normal! gvpchanges the buffer to11111111111        11 2222222    22 33 22 33 22 33 22    2222222 11  11  11  11  11  11  11        11111111111inserting the contents of the register as new lines, rather than overlaying thevisual selection.What am I doing wrong?
extra newlines when pasting altered string in visual block mode
visual block
The problem comes from the register type, you can use echo getregtype('') before and after your let @@=@@ and you'll see that the type has changed.:h getregtype() tells us that a register can have different types:v           for characterwise textV           for linewise text{width} for blockwise-visual text            for an empty or unknown registerSo when you select your rectangle with ctrl+v and then you yank it, you actually set the type of the  register to visual block (Here ^V6 actually)When you do let @@=@@ you do no respect the register type. Thus you do not past in block wise mode anymore.The correct way to set a register is to use the function setreg() which accepts as parameter the register type to set. See :h setreg()