Max chars on vim command

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Max chars on vim command

Ni Va
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).')'])

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Max chars on vim command

Tony Mechelynck
On Sun, Oct 8, 2017 at 6:50 PM, Ni Va <[hidden email]> wrote:

> 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).')'])
>

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.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Max chars on vim command

Ni Va
Le dimanche 8 octobre 2017 18:59:15 UTC+2, Tony Mechelynck a écrit :

> On Sun, Oct 8, 2017 at 6:50 PM, Ni Va <[hidden email]> wrote:
> > 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).')'])
> >
>
> 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.
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

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Max chars on vim command

Tony Mechelynck
On Sun, Oct 8, 2017 at 8:01 PM, Ni Va <[hidden email]> wrote:

> Le dimanche 8 octobre 2017 18:59:15 UTC+2, Tony Mechelynck a écrit :
>> On Sun, Oct 8, 2017 at 6:50 PM, Ni Va <[hidden email]> wrote:
>> > 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).')'])
>> >
>>
>> 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.
>
> 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

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.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.