I have the simplest requirement in a vimscript. I've been searching on Google for quite some time e.g. 1 2 3. I just want to insert a line of text!
Suppose I have a file with lines:
aaa
bbb
ddd
eee
And I just want to add the missing line ccc
after the line bbb
.
I have the beginnings of a vimscript function:
function! addLine()
normal /bbb
" MISSING LINE
wq!
endfunction
What should the missing line be?
Note that I want to then call this script on a bunch of files using using vim -c 'call addLine()' FILE
.