I would like to put the current text in a register onto line 10. How I am doing it now is yanking the text, then going up to that line and then pasting the text, but I'd like to stay on the current line. Is there a way to do something like:
12Gp " paste something onto line 12
Update: it looks like this is answered on StackOverflow: https://stackoverflow.com/a/53115840/651174.
:copy 12
:t 12 " alias
Or:
:move 12 " move current line(s) to position
:m 12 " alias
Though it works on the current line(s) or a range, and doesn't necessarily paste what's in the register.
:help :put
.:12put
would out from the default register. Is there a way to do something like:12put "a
?:put=@a
, but:put
adds a line.setline()
(IIRC the name of the function) replaces the lines. See:h functions()
, here are plenty.