>> On Tue, Mar 2, 2010 at 7:53 PM, Tony Mechelynck<antoine.mechelynck@gmail.com> wrote:
>> I suspect that moving the ":set noea wmh=0 wh=9999" command into an
>> autocommand for the VimEnter event might cure at least part of the problem
>> but I haven't tried it.
>
> That didn't seem to help.
>
>> but "vim --remote-send :new<Space>filename<CR>" (without the quotes, IIUC) might also
>> work.
>
> That works great, thanks!
>
> One thing though: if I don't have vim running, it fails with "E247: no
> registered server named "GVIM": Send failed." Is there a way to tell
> Vim to start the server if it doesn't exist? The help (from "gvim
> -h") gives the impression that sending --servername will do just that,
> but it clearly doesn't.
>
> Thanks,
> Dan
>
You might check for the existence of a Vim server first. In bash this
might be something like (I think -- I am not a bash scripting guru):
if test -z `vim --serverlist`
then
gvim --servername GVIM $1
else
vim --servername GVIM --remote-send :new\<Space\>$1\<CR\>
fi
In a Windows .bat file I don't know if it can be done, or how, but
apparently you are on Windows (I'm not) so I suppose you're better
placed than I to experiment on that platform. The above might help you
find what to go for: on Unix-like systems, test -z returns 0 (TRUE) if
the following string (in this case the stdout output of "vim
--serverlist") is the null string, otherwise it returns 1 (FALSE). $1 on
Unix is equivalent to %1 on DOS/Windows.
Best regards,
Tony.
--
There was a young poet named Dan,
Whose poetry never would scan.
When told this was so,
He said, "Yes, I know.
It's because I try to put every possible syllable into that last line
that I can."
--
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:
Post a Comment