Max chars on vim command

19 views
Skip to first unread message

Ni Va

unread,
Oct 8, 2017, 12:50:02 PM10/8/17
to vim_use
Hi,


Testing this code, it appears that testlist of 10000 chars abort call.
How is the max and how can I pass all the data by job_starting vim ?

Thank you in advance.
Niva

function! awl#testfunc(arg) "{{{
echomsg "eheh"
echomsg string(a:arg)
endfu
"}}}


" let testlist= ['1','2','3']
let nb = 1
let max = 10000
let testlist=[]
while nb < max
call add( testlist, string(nb) )
let nb+=1
endwhile
call job_start([expand('$VIMRUNTIME').'/gvim_amd64.exe', '-c', 'echo awl#testfunc('.string(testlist).')'])

Tony Mechelynck

unread,
Oct 8, 2017, 12:59:15 PM10/8/17
to vim...@googlegroups.com
A very long command-line is never a good idea.

If you want Vim to run something long and/or complicated, write it to
a vimscript and have Vim source that at startup.

See "-S {file}" and "-S" under ":help -S".


Best regards,
Tony.

Ni Va

unread,
Oct 8, 2017, 2:01:29 PM10/8/17
to vim_use
Ok I understand.

I have to split file of 1.5M lines in files versus begin/end tags.
The split-write function is working well .


So I thought to pass to this split-write func the N file'lists ~ file in N parts and then job_start on N jobs.

How would you proceed ?
Thank you Tony
Nicholas

Tony Mechelynck

unread,
Oct 8, 2017, 2:32:44 PM10/8/17
to vim...@googlegroups.com
As I said, instead of passing the whole awfully long command on the
command-line, I would write the necessary ex-commands to a file, then
pass the name of that file as the argument of a -S switch on the Vim
command-line; or, if there isn't yet a Session.vim file (or only one
that I can afford to overwrite) in the current directory, I would just
call "vim -S". If that script ends in a :q (or maybe :x or :xa, etc.)
ex-command, the called Vim will exit after processing the script. If
there isn't, it will get into interactive mode instead.

Best regards,
Tony.
Reply all
Reply to author
Forward
0 new messages