Starting arguments order

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Starting arguments order

J.Hofmann
Hello,
I 've got a long argument list (in the argument box of my VB.Net environment)
to use vim as my favorite editor.

--servername gmain --remote-silent +$(CurLine)  "+setlocal filetype=vbnet"
$(ItemPath)

where the $-Stuff gets subsituted by the VB.Net environment.
It works so far. I only want to add an addtional +"starting command" to the
already existing "+setlocal filetype=vbnet", i.e. +"normal zz"

I don't succeed in finding the correct place to fill it in the additional
command, vim i.e. regards the command as a file and trys to edit it.

Where is the place to add another command?

Thank You

Joachim
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Starting arguments order

Tim Chase-2
> I don't succeed in finding the correct place to fill it in the
>  additional command, vim i.e. regards the command as a file
> and trys to edit it.
>
> Where is the place to add another command?

I don't know if you've gotten a reply to this yet, but usually
you use -c "starting command" rather than just passing it in
quotes.  Thus, you'd have something like

        vim -c "norm ggg?G" myfile.txt

or something like that where the "norm ggg?G" is the Ex command
you'd like to run.

If you just pass it in quotes, you end up with the behavior
you're getting--Vim thinks it's a file name.

:help -c

should have further info on starting vim after executing a command.

-tim




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Starting arguments order

A.J.Mechelynck
Tim Chase wrote:

>> I don't succeed in finding the correct place to fill it in the
>>  additional command, vim i.e. regards the command as a file
>> and trys to edit it.
>>
>> Where is the place to add another command?
>
>
> I don't know if you've gotten a reply to this yet, but usually
> you use -c "starting command" rather than just passing it in
> quotes.  Thus, you'd have something like
>
>     vim -c "norm ggg?G" myfile.txt
>
> or something like that where the "norm ggg?G" is the Ex command
> you'd like to run.
>
> If you just pass it in quotes, you end up with the behavior
> you're getting--Vim thinks it's a file name.
>
> :help -c
>
> should have further info on starting vim after executing a command.
>
> -tim

The OP didn't say "norm ggg?G" but +"norm ggg?G" which is thought to be
equivalent to -c "norm ggg?G" (see ":help -+c). IIUC all arguments
should come before the file names. The examples at the above help tag
seem to imply that one should pass "+norm ggg?G" or -c "norm ggg?G"
rather than +"norm ggg?G". Maybe that's the problem?


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Starting arguments order

Tim Chase-2
> pass "+norm ggg?G" or -c "norm ggg?G" rather than +"norm
> ggg?G". Maybe that's the problem?

Bravo...good catch!  Obscure and easy to miss, especially as many
other apps use the plus-sign before the quotes.  I usually just
use the -c form, and it's worked, so I've never had cause to go
digging into that area of things.  Hopefully one of these will
help the OP get things working. :)

-tim




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Starting arguments order

J.Hofmann
In reply to this post by J.Hofmann
Tony wrote:

> The examples at the above help tag
> seem to imply that one should pass "+norm ggg?G" or -c "norm ggg?G"
> rather than +"norm ggg?G". Maybe that's the problem?

The +"normal zz" example was just a typo, I used "+normal zz", where the plus
sign is *inside* the quotes.

--> Here is a real example: with two "+" - commands:

--servername gmain --remote-silent +$(CurLine)  "+setlocal filetype=vbnet"
"+normal zz" $(ItemPath)

makes vim to open *two* buffers: one named +normal zz and another substituted
for $(ItemPath) which is the correct one.

--> Another real example with using the -c notation:

--servername gmain --remote-silent +$(CurLine)  -c "setlocal filetype=vbnet"
-c "normal zz" $(ItemPath)

makes vim to open *three* buffers: one named -c, another one named normal zz
and the third, correct one.

Joachim
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Starting arguments order

A.J.Mechelynck
Hofmann, Joachim wrote:

> Tony wrote:
>
>
>>The examples at the above help tag
>>seem to imply that one should pass "+norm ggg?G" or -c "norm ggg?G"
>>rather than +"norm ggg?G". Maybe that's the problem?
>
>
> The +"normal zz" example was just a typo, I used "+normal zz", where the plus
> sign is *inside* the quotes.
>
> --> Here is a real example: with two "+" - commands:
>
> --servername gmain --remote-silent +$(CurLine)  "+setlocal filetype=vbnet"
> "+normal zz" $(ItemPath)
>
> makes vim to open *two* buffers: one named +normal zz and another substituted
> for $(ItemPath) which is the correct one.
>
> --> Another real example with using the -c notation:
>
> --servername gmain --remote-silent +$(CurLine)  -c "setlocal filetype=vbnet"
> -c "normal zz" $(ItemPath)
>
> makes vim to open *three* buffers: one named -c, another one named normal zz
> and the third, correct one.
>
> Joachim
>
>
>
>

Does $(Curline) include a space-separated double dash? See ":help ---".

Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

AW: Starting arguments order

J.Hofmann
In reply to this post by J.Hofmann
> Tony wrote:

> Does $(Curline) include a space-separated double dash? See ":help ---".

No, $(Curline) is neatly substituted to a line number.


Joachim
Loading...