Vimscript: output to a new (split) window

Inside Vimscript, how to open a new split window and insert the contents of a variable?

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

Thank.

+3
source share
2 answers

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

+4
source

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

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

Here's how you insert characters:

Btw, IBM, :

+1

Source: https://habr.com/ru/post/1774857/


All Articles