gvim.exe --clean
:set winaltkeys=menu
// that should be the default, but being explicit here
alt+space
I should see the "system menu"--that little old-school menu at the top left corner that has entries for Restore, Move, Size, Minimize, Maximize, Close.
(Other menu entries work, like alt+f for the "File" menu, etc. It also works as expected if :set winaltkeys=yes
. But I don't think alt+space should be mapped to anything by default, so it should go to the windowing system when winaltkeys=menu.)
9.0.924
Windows 11
No response
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
If I read :h simalt and :h 'winaltkeys' correcty, you need to set :set winaltkeys=yes
to make this work. If you use the winaltkeys=menu
you need to use :simalt ~
instead, because this only works for the menu keys and I don't think the system menu belongs to the menubar. Pasting the documentation here for clarity:
Some GUI versions allow the access to menu entries by using the ALT
key in combination with a character that appears underlined in the
menu. This conflicts with the use of the ALT key for mappings and
entering special characters. This option tells what to do:
no Don't use ALT keys for menus. ALT key combinations can be
mapped, but there is no automatic handling. This can then be
done with the |:simalt| command.
yes ALT key handling is done by the windowing system. ALT key
combinations cannot be mapped.
menu Using ALT in combination with a character that is a menu
shortcut key, will be handled by the windowing system. Other
keys can be mapped.
If the menu is disabled by excluding 'm' from 'guioptions', the ALT
key is never used for the menu.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
If Christian's suggestion isn't enough, try adding the following snippet to your vimrc:
if has('wildmenu') set wildmenu if exists('+wildmode') set wildmode=longest:full,full endif set wildcharm=<C-Z> map <F10> :emenu <C-Z> imap <F10> <C-O>:emenu <C-Z> if !has('gui_running') runtime! menu.vim endif " !has('gui_running') endif " 'wildmenu'
then hitting F10
will bring up the Vim menu on the statusline in both vim and gvim for use with the keyboard. In gvim it is still available at the top of the Vim screen in the usual (mouse-clicking) manner.
The above snippet uses double-quote comments, it may imply non-Vim9 script in your vimrc, or at least that part of it, unless you rewrite or delete the comments.
Best regards,
Tony.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I am closing this.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Closed #11591 as completed.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I don't think the system menu belongs to the menubar.
Perhaps there is some technical distinction between alt+space and alt+, but IMO I don't think it makes a difference to a user: a user who wants standard alt+ to automatically work as other Windows programs, without manually mapping them or precluding other custom alt+ mappings, will probably expect alt+space to work when winaltkeys=menu, just the same as alt+f. If there is not a way to query for it, then I would suggest "space" simply be hardcoded as a "menu" key.
That said, I understand that sometimes technical distinctions are important for other reasons, or are more painful/awkward to work around than one might think. And thank you for the pointer to the :simalt
command--using that, I can work around the default behavior with the snippet below. So although I think it would be an improvement to also handle alt+space the same as other menu keys, I can live with it.
:map <M-Space> :simalt ~<CR>
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.