Stewart Johnson wrote:
On 6/22/06, Marc Weber <[EMAIL PROTECTED]> wrote:
> Upon closer inspection, netrw delegates network activity to
> wget/fetch/rsync and friends anyway, so I guess I'll do the same. It's
> given me some direction on how to handle different operatings systems
> -- 'if has("win32")' etc. It's not a robust solution, but we work
> within our confines, right? :-)

I didn't get exactly what you are trying to do .. but you have the
option to use python, ruby ....
from python you can call any C function.. So it should no problem to
create a TCP connection.. ;-)

Wait, what? I can access python and ruby from within a vim script?

Yes, if your version of Vim has been compiled for it. Until Vim version 6, four interpreted languages were supported, and a fifth one has been added at version 7. Check the ouput of the ":version" command for:

+mzscheme or -mzscheme (version 7 only)
+perl or -perl
+python or -python
+ruby or -ruby
+tcl or -tcl

You can also access these individually through the "has()" function. For instance, in a Vim version compiled with perl support,

        :echo has("perl")

answers 1. (A zero value means "no".)


What I'm trying to do is to write a vim script that will take some
information from the current open buffer, send it to a web service,
receive information back from the webservice, and display it in the
vim buffer (and another buffer). Everything I need is available in vim
scripting, apart from being able make HTTP POSTs to webservices.

It looks like I can't make an arbitrary TCP connection from within vim
(please correct me if I'm wrong!) so I'll need to use the system()
function in my vim script to do that (like netrw does). And since I
want it to be cross-platform, I'll need to do a bunch of operating
system snooping to figure out what I can use to make the network
access.

Stewart



Best regards,
Tony.

Reply via email to