I have this in my '~/.vimrc
' (among other things):
set guioptions += M
set guioptions -= m
to disable the menus in MacVim. I find that leaving out the '+=M
' results in lots of keys being mapped (the menu hot keys etc.).
There is one facility provided by the system menu that I really would like: the ability to show all current MacVim "windows" (in the operating system sense, and not in the Vim sense of a "split"). For example, I could do something like this (perhaps in separate shells, at separate times):
$ mvim foo.txt
$ mvim bar.txt
$ mvim baz.txt
This will result in 3 separate MacVim "windows". With "set go=+M" not set, I can go to the "Windows" menu and see a these three instances listed and, optionally, select one of them.
Is there any way to do this without enabling the system menu, or at least the rest of it?
My motivation is this: after a while, I tend to end up with lots of different MacVim "windows" across multiple desktop spaces (I also tend to use a lot of desktop spaces). Sometimes I try to open, e.g., "foo.txt", only to get the notification that "foo.txt" is already open. Hunting down window in which it is open is a hassle. Yes, yes, I suppose I could change my entire way of dealing with this --- restricting myself to just one MacVim window, being disciplined about quitting files that I am not immediately working on etc. etc. But short of that, is there something else I could be doing?
I would also be happy if there was a command that I could issue either from the shell or from within Vim, that lists the windows and allowed me to activate one of my choice.
Edit
Turns out that MacVim has a ':macaction selectNextWindow:
' command that at least allows me to cycle through the various instances:
nnoremap <silent> <M-`> :macaction selectNextWindow:<CR>
nnoremap <silent> <D-`> :macaction selectNextWindow:<CR>
nnoremap <silent> <M-S-`> :macaction selectPreviousWindow:<CR>
nnoremap <silent> <D-S-`> :macaction selectPreviousWindow:<CR>
I mapped both the command ('<D->
') and meta ('<M->
') because the former mapping only works with MacVim windows in the same desktop space. Weird. A partial solution in that I (eventually) find the window/instance I want, but at O(n)
complexity. A window list would make it O(1)
.