Windows: opening already open files

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

Windows: opening already open files

Steven An
I often double-click files in Windows Explorer and have them open in
VIM. But if the file is already opened, vim will complain and what not
- I could just "edit anyway", but I'd like for it to pop up the Vim
window that has that file opened. Is there a way to do this? Thanks.
--Steve

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Windows: opening already open files

Jean-Rene David-2
* Steven An [2011.11.14 04:20]:
> I often double-click files in Windows Explorer and have them open in
> VIM. But if the file is already opened, vim will complain and what not

"will complain and what not" is not a very precise
description. I'm going to go out on a limb here
and guess you get the message described here:

:h E325

(which you might want to read)

> - I could just "edit anyway", but I'd like for it to pop up the Vim
> window that has that file opened. Is there a way to do this? Thanks.

Preferred solution: you could use the 'Edit with
existing vim', which doesn't exhibit this behavior
since you're just redirected to the open file.

Other solutions with ramifications you need to be
aware of:

:set shortmess+=A

or

:set noswapfile

Just make sure you realize what the consequences
are of not those settings.

--
JR

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Windows: opening already open files

Andy Wokula
In reply to this post by Steven An
Am 14.11.2011 06:38, schrieb Steven An:
> I often double-click files in Windows Explorer and have them open in
> VIM. But if the file is already opened, vim will complain and what not
> - I could just "edit anyway", but I'd like for it to pop up the Vim
> window that has that file opened. Is there a way to do this? Thanks.
> --Steve

Vim provides the  $VIMRUNTIME/macros/editexisting.vim  script for that
purpose.  It's a normal plugin.

Either (this is what I use)
     copy that file to your plugin folder
or add (untested)
     runtime macros/editexisting.vim
to your vimrc.

--
Andy

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