views:

28

answers:

1

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
The third way is `:$put=variable`
Luc Hermitte
Perfect, thanks!
Ricardo