Thursday, February 24, 2011

Re: Single Instance in Console?

On Thu, 24 Feb 2011, Marko Mahnič wrote:

> On Feb 23, 10:17 pm, howardb21 wrote:
>> Is there some way one could use only one instance of vim, when
>> editing files in a plain old unix shell? Only way I can think of,
>> offhand, is to write a vim shell script that ran instead of vim.exe.
>> Then, vim filename  -- would check if an instance of vim was already
>> running or suspended. If so, it would first write a little file
>> containing :arge filename. Then it would execute a fg or exit shell
>> command. In turn vim would source the little file when it wakes up,
>> via an autocommand for the shellcmdPost event.
>>
>> Any more elegant way to do this?
>
> This may be what you are looking for:
>
> X terminal 1:
> vim --servername THEONE
>
> X terminal 2:
> vim --servername THEONE --remote file_to_edit.txt
>
> This should open the file in vim running in terminal 1.

It was only explicitly mentioned in the subject line, but the OP appears
to want to do this under the console. So, no X11 running (or at least
inactive), which in turn means that that X11-based +clientserver-related
options aren't available.

Is there anything in particular that ties the functionality to the X
server? Or was it just chosen as a simple(?) IPC mechanism?

--
Best,
Ben

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