开发者

Vimscript: outputting into a new (split) window

From within Vimscript, how does one open a new开发者_如何学Go split window and insert the contents of a variable?

I'm trying to write a script that applies a function to the current buffer and displays the result in a split window.

Thanks.


To open a new window, use :split. To insert the contents of a variable, use :call append(0, g:some_var)


I never used vimscript (excluding simple keyboard mappings and settings), but here are some links that might help:

Here's how to make a new split window (take a look at the source):

  • http://www.vtk.org/Bug/view.php?id=11310

Here's how you insert characters:

  • http://captsolo.net/info/blog_b.php/2004/07/31/a_vim_script_to_insert_the_current_line_

Btw, here's a very nice IBM tutorial that might be useful:

  • http://www.ibm.com/developerworks/linux/library/l-vim-script-5/index.html
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜