Thanks.  This gets me close to what I want...

        nnoremap <2-LeftMouse> :!start gvim -t <cword><CR>

The only problem is that it will start up a new gvim even if the tag is in the 
file that I started from.  So, you get the same file opened twice, in two 
windows.

Anybody know how to avoid that?

--Bill


-----Original Message-----
From: Gary Johnson [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 23, 2007 5:14 PM
To: vim@vim.org
Subject: Re: Jump to tag opens VIM in a new Microsoft Windows XP window

On 2007-03-23, "Waters, Bill" <[EMAIL PROTECTED]> wrote:
> When I jump to a tag reference in a different file, can I have VIM 
> open that file in a new Microsoft Window?  As it works now, I jump 
> to the new file in the same VIM session.  I have three problems 
> with that:
> 
> 1. VIM will not jump to the tag unless all of the changes in my 
> current file have been saved.

You can fix this by making the current buffer hidden before 
executing the jump.  See

    :help hidden
    :help bufhidden
    :help hide

> 2. When I jump to the new file, I loose the undo buffer for the 
> previous file.

Making the buffer hidden will fix that, too.

> 3. I would prefer to look at the new file in a separate, 
> side-by-side Microsoft Window.

In that case, you could map your "jump to tag" key to a command that 
would execute

    gvim -t <cword>

I'll leave that to you to figure out since it may require ":!start 
gvim ..." instead of just ":!gvim ..." and I don't do Windows that 
much.  See

    :help :!
    :help :!start
    :help -t
    :help map.txt

HTH,
Gary

-- 
Gary Johnson                 | Agilent Technologies
[EMAIL PROTECTED]     | Mobile Broadband Division
                             | Spokane, Washington, USA

Reply via email to