Thursday, February 24, 2011

Re: Single Instance in Console?

On Feb 23, 10:17 pm, howardb21 <howard...@gmail.com> 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.

Marko

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