Skip to content

Support fixing "menu not found" error when started through mvim with default menus disabled. #1231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion runtime/doc/gui_mac.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*gui_mac.txt* For Vim version 8.2. Last change: 2020 Aug 13
*gui_mac.txt* For Vim version 8.2. Last change: 2022 Jan 24


VIM REFERENCE MANUAL by Bjorn Winckler
Expand Down Expand Up @@ -94,6 +94,18 @@ with the Apple Human Interface Guidelines (HIG).
The Help menu's search can be used to search Vim's documentation. You can use
it to quickly find the documentation you want in addition to using |:help|.

If you want to disable configuration of command key equivalents when Vim
sources |menu.vim| you can add this line to your .vimrc file: >
:let did_install_default_mac_menus = 1

This is particularly useful if you have opted to disable generation of the
default menus themselves (by setting 'did_install_default_menus = 1').
Otherwise, you may get errors on startup due to missing menus.

Because 'filetype' and 'syntax' both cause Vim to source |menu.vim|, you
must set 'did_install_default_mac_menus' before executing those commands in
your .vimrc.

*macvim-window-title*
The default window title does not include the argument list because it looks
really bad once you start using tabs. For example, dropping two files, then
Expand Down
115 changes: 59 additions & 56 deletions runtime/menu.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1299,62 +1299,65 @@ unlet s:cpo_save


if has("gui_macvim")
"
" Set up menu key equivalents (these should always have the 'D' modifier
" set), action bindings, and alternate items.
"
" Note: menu items which should execute an action are bound to <Nop>; the
" action message is specified here via the :macmenu command.
"
macm File.New\ Window key=<D-n> action=newWindow:
macm File.New\ Tab key=<D-t>
macm File.Open… key=<D-o> action=fileOpen:
macm File.Open\ Tab\.\.\.<Tab>:tabnew key=<D-T>
macm File.Open\ Recent action=recentFilesDummy:
macm File.Close\ Window<Tab>:qa key=<D-W>
macm File.Close key=<D-w> action=performClose:
macm File.Save<Tab>:w key=<D-s>
macm File.Save\ All key=<D-M-s> alt=YES
macm File.Save\ As…<Tab>:sav key=<D-S>
macm File.Print key=<D-p>

macm Edit.Undo<Tab>u key=<D-z> action=undo:
macm Edit.Redo<Tab>^R key=<D-Z> action=redo:
macm Edit.Cut<Tab>"+x key=<D-x> action=cut:
macm Edit.Copy<Tab>"+y key=<D-c> action=copy:
macm Edit.Paste<Tab>"+gP key=<D-v> action=paste:
macm Edit.Select\ All<Tab>ggVG key=<D-a> action=selectAll:
macm Edit.Find.Find… key=<D-f>
macm Edit.Find.Find\ Next key=<D-g> action=findNext:
macm Edit.Find.Find\ Previous key=<D-G> action=findPrevious:
macm Edit.Find.Use\ Selection\ for\ Find key=<D-e> action=useSelectionForFind:
macm Edit.Font.Show\ Fonts action=orderFrontFontPanel:
macm Edit.Font.Bigger key=<D-=> action=fontSizeUp:
macm Edit.Font.Smaller key=<D--> action=fontSizeDown:

macm Tools.Spelling.To\ Next\ Error<Tab>]s key=<D-;>
macm Tools.Spelling.Suggest\ Corrections<Tab>z= key=<D-:>
macm Tools.Make<Tab>:make key=<D-b>
macm Tools.List\ Errors<Tab>:cl key=<D-l>
macm Tools.Next\ Error<Tab>:cn key=<D-C-Right>
macm Tools.Previous\ Error<Tab>:cp key=<D-C-Left>
macm Tools.Older\ List<Tab>:cold key=<D-C-Up>
macm Tools.Newer\ List<Tab>:cnew key=<D-C-Down>

macm Window.Minimize key=<D-m> action=performMiniaturize:
macm Window.Minimize\ All key=<D-M-m> action=miniaturizeAll: alt=YES
macm Window.Zoom key=<D-C-z> action=performZoom:
macm Window.Zoom\ All key=<D-M-C-z> action=zoomAll: alt=YES
macm Window.Toggle\ Full\ Screen\ Mode key=<D-C-f>
macm Window.Show\ Next\ Tab key=<D-}>
macm Window.Show\ Previous\ Tab key=<D-{>
macm Window.Bring\ All\ To\ Front action=arrangeInFront:
macm Window.Stay\ in\ Front action=stayInFront:
macm Window.Stay\ in\ Back action=stayInBack:
macm Window.Stay\ Level\ Normal action=stayLevelNormal:

macm Help.MacVim\ Help key=<D-?>
macm Help.MacVim\ Website action=openWebsite:
if !exists("did_install_default_mac_menus")
let did_install_default_mac_menus = 1
"
" Set up menu key equivalents (these should always have the 'D' modifier
" set), action bindings, and alternate items.
"
" Note: menu items which should execute an action are bound to <Nop>; the
" action message is specified here via the :macmenu command.
"
macm File.New\ Window key=<D-n> action=newWindow:
macm File.New\ Tab key=<D-t>
macm File.Open… key=<D-o> action=fileOpen:
macm File.Open\ Tab\.\.\.<Tab>:tabnew key=<D-T>
macm File.Open\ Recent action=recentFilesDummy:
macm File.Close\ Window<Tab>:qa key=<D-W>
macm File.Close key=<D-w> action=performClose:
macm File.Save<Tab>:w key=<D-s>
macm File.Save\ All key=<D-M-s> alt=YES
macm File.Save\ As…<Tab>:sav key=<D-S>
macm File.Print key=<D-p>

macm Edit.Undo<Tab>u key=<D-z> action=undo:
macm Edit.Redo<Tab>^R key=<D-Z> action=redo:
macm Edit.Cut<Tab>"+x key=<D-x> action=cut:
macm Edit.Copy<Tab>"+y key=<D-c> action=copy:
macm Edit.Paste<Tab>"+gP key=<D-v> action=paste:
macm Edit.Select\ All<Tab>ggVG key=<D-a> action=selectAll:
macm Edit.Find.Find… key=<D-f>
macm Edit.Find.Find\ Next key=<D-g> action=findNext:
macm Edit.Find.Find\ Previous key=<D-G> action=findPrevious:
macm Edit.Find.Use\ Selection\ for\ Find key=<D-e> action=useSelectionForFind:
macm Edit.Font.Show\ Fonts action=orderFrontFontPanel:
macm Edit.Font.Bigger key=<D-=> action=fontSizeUp:
macm Edit.Font.Smaller key=<D--> action=fontSizeDown:

macm Tools.Spelling.To\ Next\ Error<Tab>]s key=<D-;>
macm Tools.Spelling.Suggest\ Corrections<Tab>z= key=<D-:>
macm Tools.Make<Tab>:make key=<D-b>
macm Tools.List\ Errors<Tab>:cl key=<D-l>
macm Tools.Next\ Error<Tab>:cn key=<D-C-Right>
macm Tools.Previous\ Error<Tab>:cp key=<D-C-Left>
macm Tools.Older\ List<Tab>:cold key=<D-C-Up>
macm Tools.Newer\ List<Tab>:cnew key=<D-C-Down>

macm Window.Minimize key=<D-m> action=performMiniaturize:
macm Window.Minimize\ All key=<D-M-m> action=miniaturizeAll: alt=YES
macm Window.Zoom key=<D-C-z> action=performZoom:
macm Window.Zoom\ All key=<D-M-C-z> action=zoomAll: alt=YES
macm Window.Toggle\ Full\ Screen\ Mode key=<D-C-f>
macm Window.Show\ Next\ Tab key=<D-}>
macm Window.Show\ Previous\ Tab key=<D-{>
macm Window.Bring\ All\ To\ Front action=arrangeInFront:
macm Window.Stay\ in\ Front action=stayInFront:
macm Window.Stay\ in\ Back action=stayInBack:
macm Window.Stay\ Level\ Normal action=stayLevelNormal:

macm Help.MacVim\ Help key=<D-?>
macm Help.MacVim\ Website action=openWebsite:
endif
endif

if has("touchbar")
Expand Down