From https://vi.stackexchange.com/a/28026/47188 I know that by defining in vimrc:
" Insert text at the current cursor position.
function! InsertText(text)
let cur_line_num = line('.')
let cur_col_num = col('.')
let orig_line = getline('.')
let modified_line =
\ strpart(orig_line, 0, cur_col_num - 1)
\ . a:text
\ . strpart(orig_line, cur_col_num - 1)
" Replace the current line with the modified line.
call setline(cur_line_num, modified_line)
" Place cursor on the last character of the inserted text.
call cursor(cur_line_num, cur_col_num + strlen(a:text))
endfunction
Then call it as:
let text = "Lorem ipsum sit dolor amet ..."
call InsertText(text)
The text would be inserted.
However, is it possible to insert multiple lines, for example, insert "hello", then the context in text, then "world" in the current line below?