Multiple buffers instead of multiple instances

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple buffers instead of multiple instances

Giorgos Gaganis
Hello

I am using eclipse as my dev environment and I use gvim as my editor for
files other than java.
When I open a file that I have associated to be opened with gvim a new
instance of gvim is created.

What I would like would be to have only one instance and every new file
to be opened in a new buffer within that instance.

Eclipse doesn't offer any other options except from selecting an exe.

Any help would be greatly appreciated
Giorgos

Reply | Threaded
Open this post in threaded view
|

Re: Multiple buffers instead of multiple instances

Marian Csontos
Hi Giorgos,

see :help --remote

Regards

-- Marian

On Tue, 20 Sep 2005 09:15:46 +0200, Giorgos Gaganis  
<[hidden email]> wrote:

> Hello
>
> I am using eclipse as my dev environment and I use gvim as my editor for  
> files other than java.
> When I open a file that I have associated to be opened with gvim a new  
> instance of gvim is created.
>
> What I would like would be to have only one instance and every new file  
> to be opened in a new buffer within that instance.
>
> Eclipse doesn't offer any other options except from selecting an exe.
>
> Any help would be greatly appreciated
> Giorgos
>


________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Server.
http://www.nod32.com
Reply | Threaded
Open this post in threaded view
|

Re: Multiple buffers instead of multiple instances

Giorgos Gaganis
Marian Csontos wrote:

> Hi Giorgos,
>
> see :help --remote

I have looked at that but my problem still remains. The problem is that
I have not found a way in eclipse to add options to the command that
starts gvim.

I hoped there would be an option or way to make vim act like other
programs which instead of opening a new instance they just load the file.

>
> Regards
>
> -- Marian
>
> On Tue, 20 Sep 2005 09:15:46 +0200, Giorgos Gaganis  
> <[hidden email]> wrote:
>
>> Hello
>>
>> I am using eclipse as my dev environment and I use gvim as my editor
>> for  files other than java.
>> When I open a file that I have associated to be opened with gvim a
>> new  instance of gvim is created.
>>
>> What I would like would be to have only one instance and every new
>> file  to be opened in a new buffer within that instance.
>>
>> Eclipse doesn't offer any other options except from selecting an exe.
>>
>> Any help would be greatly appreciated
>> Giorgos
>>
>
>
> ________ Information from NOD32 ________
> This message was checked by NOD32 Antivirus System for Linux Mail Server.
> http://www.nod32.com
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Multiple buffers instead of multiple instances

Dominic Evans
Just make a batch file gvim.bat that contains

c:\Program Files\vim\vim7aa\gvim.exe --remote %1

And point eclipse at that.

Dom

On 20/09/05, Giorgos Gaganis <[hidden email]> wrote:

> Marian Csontos wrote:
>
> > Hi Giorgos,
> >
> > see :help --remote
>
> I have looked at that but my problem still remains. The problem is that
> I have not found a way in eclipse to add options to the command that
> starts gvim.
>
> I hoped there would be an option or way to make vim act like other
> programs which instead of opening a new instance they just load the file.
>
> >
> > Regards
> >
> > -- Marian
> >
> > On Tue, 20 Sep 2005 09:15:46 +0200, Giorgos Gaganis
> > <[hidden email]> wrote:
> >
> >> Hello
> >>
> >> I am using eclipse as my dev environment and I use gvim as my editor
> >> for  files other than java.
> >> When I open a file that I have associated to be opened with gvim a
> >> new  instance of gvim is created.
> >>
> >> What I would like would be to have only one instance and every new
> >> file  to be opened in a new buffer within that instance.
> >>
> >> Eclipse doesn't offer any other options except from selecting an exe.
> >>
> >> Any help would be greatly appreciated
> >> Giorgos
> >>
> >
> >
> > ________ Information from NOD32 ________
> > This message was checked by NOD32 Antivirus System for Linux Mail Server.
> > http://www.nod32.com
> >
> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Multiple buffers instead of multiple instances

Hari Krishna Dara
In reply to this post by Giorgos Gaganis

On Tue, 20 Sep 2005 at 10:15am, Giorgos Gaganis wrote:

> Hello
>
> I am using eclipse as my dev environment and I use gvim as my editor for
> files other than java.
> When I open a file that I have associated to be opened with gvim a new
> instance of gvim is created.
>
> What I would like would be to have only one instance and every new file
> to be opened in a new buffer within that instance.
>
> Eclipse doesn't offer any other options except from selecting an exe.
>
> Any help would be greatly appreciated
> Giorgos
>

I don't use eclipse myself, but here is the command that I use in a
different tool that is configured to execute gvim as an external
command:

gvim -u NONE --servername GVIM --remote +%l %f

The "%l" and "%f" are replaced with line number and filename by the tool
before executing the command and the name of the gvim window is
hardcoded to "GVIM". I make sure a gvim instance with that name is
already started before starting to use this feature. Alternatively, you
could remove the "-u NONE" option such that you don't have to have gvim
started in advance. I don't know if "-u NONE" makes the execution of
external command faster, but I believe it does.

--
HTH,
Hari


       
               
______________________________________________________
Yahoo! for Good
Donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/ 

Reply | Threaded
Open this post in threaded view
|

Re: Multiple buffers instead of multiple instances

A.J.Mechelynck
----- Original Message -----
From: "Hari Krishna Dara" <[hidden email]>
To: "Giorgos Gaganis" <[hidden email]>
Cc: <[hidden email]>
Sent: Tuesday, September 20, 2005 7:40 PM
Subject: Re: Multiple buffers instead of multiple instances


>
> On Tue, 20 Sep 2005 at 10:15am, Giorgos Gaganis wrote:
>
>> Hello
>>
>> I am using eclipse as my dev environment and I use gvim as my editor for
>> files other than java.
>> When I open a file that I have associated to be opened with gvim a new
>> instance of gvim is created.
>>
>> What I would like would be to have only one instance and every new file
>> to be opened in a new buffer within that instance.
>>
>> Eclipse doesn't offer any other options except from selecting an exe.
>>
>> Any help would be greatly appreciated
>> Giorgos
>>
>
> I don't use eclipse myself, but here is the command that I use in a
> different tool that is configured to execute gvim as an external
> command:
>
> gvim -u NONE --servername GVIM --remote +%l %f
>
> The "%l" and "%f" are replaced with line number and filename by the tool
> before executing the command and the name of the gvim window is
> hardcoded to "GVIM". I make sure a gvim instance with that name is
> already started before starting to use this feature. Alternatively, you
> could remove the "-u NONE" option such that you don't have to have gvim
> started in advance. I don't know if "-u NONE" makes the execution of
> external command faster, but I believe it does.
>
> --
> HTH,
> Hari

"-u NONE" prevents sourcing the vimrc, gvimrc, and all plugins. It is either
faster, or the same speed if --remote already does the same.

If you don't want to check whether gvim is already started, not only don't
use "-u NONE", but also use --remote-silent rather than --remote (in order
to avoid an error message if gvim isn't running yet).

If Eclipse has no provision for %l %f, and always postposes the filename,
you could try using "gvim --servername GVIM --remote-silent" as the program
name, and if that doesn't work, either

either (a) define a shell alias

(bash)
    alias gvremote = 'gvim --servername GVIM --remote-silent'

(4NT) IIUC:
    alias gvremote gvim --servername GVIM --remote-silent

or (b) write a shell script:
(Unix/Linux) /usr/local/bin/gvremote
    #!/bin/bash
    gvim --servername GVIM --remote-silent $1

(Dos/Windows) C:\Program Files\vim\vim63\gvremote.bat
    @echo off
    gvim --servername GVIM --remote-silent %1

Then assign "gvremote" as the name of your external editor for Eclipse. (The
alias method assumes Eclipse calls the editor via the shell.)


Best regards,
Tony.