macvim icon indicating copy to clipboard operation
macvim copied to clipboard

Allow bringing window to top instead of opening a new editor on a file that is already being edited

Open andrewcmyers opened this issue 1 year ago • 1 comments

My primary pain point with MacVim is that I often want to edit a file I am already editing, somewhere in the deep stack of windows. It would be a time-saver if it were easier to just bring that window to the top with keyboard focus, in the case where I am editing that file, but instead create a new editing window in the case where I am not currently editing it. Currently it always opens an editing window but then warns me that the file is already being edited, which is better than not warning, but also not as efficient as it could be.

Ideally there would be an option to gvim that tells it just to wake up the existing editor window if the file is already being edited.

The main alternative is to write a script to detect whether a file is being edited, using AppleScript to bring the appropriate window to the foreground. I've actually written such a script but it seems unnecessarily painful.

andrewcmyers avatar Oct 20 '24 15:10 andrewcmyers

So there is already this option:

image

When you open the file it should find the currently editing buffer and switch to that. Does that not work for you? I think that option may not work when using the mvim script though.

ychin avatar Oct 21 '24 18:10 ychin