When I have some text indented as follows (like a
and b
variables assignment):
if(condition)
a = 1;
b = 2;
end
and I want to paste a
and b
block somewhere outside of the if
block, i.e just after it, vim adds the indentation starting from the second line of visual selection, resulting:
a = 1;
b = 1;
Does exist such an option that don't expand the indentation (better said that maintains relative column alignment for each line) when text is pasted, without using a custom function ?
EDIT: I mainly use gvim.
EDIT2:
I have already tried set paste
and set nopaste
without success.
p
orP
)?echo getregtype('+')
. Also describe how did you copy."+ygv
and paste using"+P"
. Thegetregtype('+')
ofcourse returns the yanked text. Don't you experience the same behaviour ?getregtype('+')
, notgetreg('+')
. I think it's result it's result might bev
. How did you complete visual selection before you callgv
? And shouldn't it begv"+y
?