Tuesday, November 6, 2012

Re: Launch vimscript from Win system

Le mercredi 7 novembre 2012 03:32:28 UTC+1, DrChip a écrit :
> Marc Weber wrote: > Excerpts from niva's message of Tue Nov 06 16:32:26 +0100 2012: >> I would like to launch those vimscript functions by external system call.(system win32). > What do you mean by "external sytsem call."? > > The only way to communicate with vim from the outsied is by using > client-srever or the netbeans api. > > You can't call viml code from the outside (like using a dll) - all you > can do is "write input to a file", "call vim whih writes output to a > second file", "read result" like things, and little nicer by using the > client-server features. :h client-server :h netbeans > > I'd consider rewriting your code in another language such as python > - depending on how much it is. You can run python from within vim, but > also outside of Vim > I think I'm going to disagree here -- perhaps vim's -c option will help. See :help -c . As an example, consider vim -c "echo 'hello'" -c "sleep 3" -c q which will run vim, show "hello" in the messages, wait 3 seconds, and then quit. So, you presumably could vim -c "call MyFunction()" -c q and vim will run your function. Now, I agree with Marc that I don't really know what you mean by running vim via an "external system call". How do you intend to launch vim? If by an icon, you presumably could set its "properties" so as to run vim with the -c arguments as I showed. If you're using cygwin or the dos-shell, again, you could run vim as shown (you may need to specify the full path). I also agree with Marc that you can't really interact with vim via an external interface other than via the client-server or netbeans mechanisms (well, mostly not; I've managed to put together something that lets gdb talk to vim under linux/unix systems). Regards, Chip Campbell

Yes that's the good answer.
Thank you

--
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

No comments: