Re: Allow only one instance of vim on Windows

2006-08-23 Thread Robert Hicks

Manu Anand wrote:

Funny!!
I was thinking about this y'day.

I think this would be more than one option.
This option should exist for each opened instance of VIM.
We can probably change the functionality of Edit with existing
filename to open in a new tab.

Wotsay?



I would rather the behavior be to open in a new tab as well on Windows.

:Robert



RE: Allow only one instance of vim on Windows

2006-08-23 Thread David Fishburn
 

 -Original Message-
 From: Stelian Iancu [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, August 22, 2006 3:59 AM
 To: vim@vim.org
 Subject: Allow only one instance of vim on Windows
 
 Hello there,
 
 I've been using vim on and off for about 5 years now but now 
 I've decided to switch entirely to vim.
 
 Up until now I've used UltraEdit and this one can be 
 configured that every file that I open with it is opened in 
 another tab of the existing instance. Can vim 7.x be 
 configured to behave the same?

Depends on how you work within windows to launch files, which will dictate
how easy this is.

For example, on windows I always work from command prompts.
When I want to edit a file I type:
vimt.cmd filename

Vimt.cmd does the following:


@rem Default the instance name to GVIM - Vims default
@set vim_instance=GVIM

@rem Override it if necessary
if %2. NEQ . set vim_instance=%2
@echo on
@echo %0
start gvim.exe --servername %vim_instance% --remote-tab-silent %1 


That will do what you want.

HTH,
Dave



Re: Allow only one instance of vim on Windows

2006-08-23 Thread Pete Johns
On Tue, 2006-08-22 at 17:49:09 -0400, Jack Donohue sent:
Not exactly what you were asking for, but Vim 7 seems to have a
right mouse button context menu items for starting a new
instance of vim or opening the file in the existing instance.

Indeed it does, but this won't start a new tab for you. If you
specifically want to open new tabs for files, the following
solution may work for you:

1. Create a Windows shortcut in %USERPROFILE%\SendTo
2. For the location of the item, enter 
C:\Program Files\Vim\vim70\gvim.exe --servername GVIM 
--remote-tab-silent
3. Give your shortcut an appropriate name.
4. You can now right-click on files and Send To a new Vim Tab.

Hope this helps;


-- 
Pete Johns   http://johnsy.com/
Contact Information  http://johnsy.com/contact/
Taking Stock   http://johnsy.com/20060821101816
dsc00220  http://johnsy.com/albums/flickr/210370644


pgpEROr2dx7BW.pgp
Description: PGP signature


Re: Allow only one instance of vim on Windows

2006-08-22 Thread Bob Hiestand

On 8/22/06, Bob Hiestand [EMAIL PROTECTED] wrote:

On 8/22/06, Stelian Iancu [EMAIL PROTECTED] wrote:
 Hello there,

 I've been using vim on and off for about 5 years now but now I've
 decided to switch entirely to vim.

 Up until now I've used UltraEdit and this one can be configured that
 every file that I open with it is opened in another tab of the
 existing instance. Can vim 7.x be configured to behave the same?

 Thanks and regards,
 Stelian

Stelian,

 You may wish to look into the '--remote-silent' option.  I've used
it in the past to achieve a similar situation on Linux; I haven't
tried it on Windows.  If you follow this route, you may want to create
a batch command to call instead the executable to massage the
parameters so that, for instance, if no parameters are supplied, it
may just bring the existing instance to the foreground or open a new
buffer (with --remote-send).


Additionally, you may wish to look into the 'foreground()' and
'remote-foreground()' functions.


Re: Allow only one instance of vim on Windows

2006-08-22 Thread Bob Hiestand

On 8/22/06, Stelian Iancu [EMAIL PROTECTED] wrote:

Hello there,

I've been using vim on and off for about 5 years now but now I've
decided to switch entirely to vim.

Up until now I've used UltraEdit and this one can be configured that
every file that I open with it is opened in another tab of the
existing instance. Can vim 7.x be configured to behave the same?

Thanks and regards,
Stelian


Stelian,

You may wish to look into the '--remote-silent' option.  I've used
it in the past to achieve a similar situation on Linux; I haven't
tried it on Windows.  If you follow this route, you may want to create
a batch command to call instead the executable to massage the
parameters so that, for instance, if no parameters are supplied, it
may just bring the existing instance to the foreground or open a new
buffer (with --remote-send).


Re: Allow only one instance of vim on Windows

2006-08-22 Thread William O'Higgins Witteman
On Tue, Aug 22, 2006 at 09:59:29AM +0200, Stelian Iancu wrote:
Hello there,

I've been using vim on and off for about 5 years now but now I've
decided to switch entirely to vim.

Up until now I've used UltraEdit and this one can be configured that
every file that I open with it is opened in another tab of the
existing instance. Can vim 7.x be configured to behave the same?

As a corollary to this request, I have a Feature Request.  In Windows,
can there be a context menu item for Open in a New Tab in Current Vim.
I find myself looking for that several times a day.
-- 

yours,

William


Re: Allow only one instance of vim on Windows

2006-08-22 Thread Manu Anand

Funny!!
I was thinking about this y'day.

I think this would be more than one option.
This option should exist for each opened instance of VIM.
We can probably change the functionality of Edit with existing
filename to open in a new tab.

Wotsay?


Manu

On 8/22/06, William O'Higgins Witteman [EMAIL PROTECTED] wrote:

On Tue, Aug 22, 2006 at 09:59:29AM +0200, Stelian Iancu wrote:
Hello there,

I've been using vim on and off for about 5 years now but now I've
decided to switch entirely to vim.

Up until now I've used UltraEdit and this one can be configured that
every file that I open with it is opened in another tab of the
existing instance. Can vim 7.x be configured to behave the same?

As a corollary to this request, I have a Feature Request.  In Windows,
can there be a context menu item for Open in a New Tab in Current Vim.
I find myself looking for that several times a day.
--

yours,

William



Re: Allow only one instance of vim on Windows

2006-08-22 Thread Jack Donohue
Not exactly what you were asking for, but Vim 7 seems to have a right mouse 
button context menu items for starting a new instance of vim or opening the 
file in the existing instance.



Jack 



Re: Allow only one instance of vim on Windows

2006-08-22 Thread Manu Anand

On 8/22/06, Jack Donohue [EMAIL PROTECTED] wrote:

Not exactly what you were asking for, but Vim 7 seems to have a right mouse
button context menu items for starting a new instance of vim or opening the
file in the existing instance.


Yes.I understand the same.
I was trying to edit the registry settings to open the same in a new tab.
Much more cleaner..

Off the top of my head of my head, I remember somebody writing a a
script for converting buffers to tabs.I might have to use the same if
I get really desperate.

Manu





Jack