开发者

Appending a message to a buffer from a Vim script

What's the best way to append the content of 开发者_如何学JAVAa string variable from a Vim script?


If variable contains no newlines, then use

call append(line('$'), [variable])

, you can also do

call append(line('$'), split(variable, "\n"))

,

execute "normal! Go".variable

, or

execute "normal! Go\<C-r>\<C-r>=variable\<CR>"


You could also put the variable into a register like this:

let @a = variable

normal! G

execute "put a"

This works with or without carriage returns.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜