What's the best way to append the content of a string variable from a Vim script?
+3
A:
If variable contains no newlines, then use
call append(line('$'), [variable])
, you can also do
call append(line('$'), split(variable, "\n"))
,
exe "normal! $o".variable
, or
exe "normal! $o\<C-r>\<C-r>=variable\<CR>"
ZyX
2010-08-05 18:02:41
The third way is `:$put=variable`
Luc Hermitte
2010-08-06 10:43:38
Perfect, thanks!
Ricardo
2010-08-06 19:06:59