sponsor Vim development Vim logo Vim Book Ad

basic Tip #645: Enabling Windows shortcuts (eg alt+space, F10 etc) for gvim window

 tip karma   Rating 1/1, Viewed by 924 

created:   January 28, 2004 4:44      complexity:   basic
author:   Girish Gajwani      as of Vim:   5.7

I was trying to figure out why Alt+space would not work, as i would have to use the mouse to maximize/restore/minimize my gvim window (on Win32) which was a pain
and found that i needed to
     set winaltkeys=yes
to make this work. Now I can use
Alt+Space followed by 'x to maximize
Alt+Space followed by 'n' to minimize
Alt+Space followed by 'r' to restore!
See
help winaltkeys

Also see this:
vimtip #494

 rate this tip  Life Changing Helpful Unfulfilling 

<<restoring indent for '#' | moving lines up/down in a file >>

Additional Notes

[email protected], January 28, 2004 5:19
I use VIM  on Win2K, ALT+Space works well on English Win2K platform, it seems this shortcut does not work on multi-byte language Win2K (e.g. Chinese Win2K). Is this a bug ?
slackorama@GOAWAYSPAMMERS_hotmail.com, January 28, 2004 18:28
I'm using vim 6.1 on WinXP and the Alt+Space works for me but not in the normal way.  I have to press Alt, release it and then press the space bar to bring up the menu.  In most other programs I can press and hold Alt and then hit the space bar.
[email protected], May 24, 2004 3:37
Hi,

I always use alt-space - n to minimise windows, even though Ctrl-Z does it, but its always
annoyed me that the system menu under alt-space hasn't worked unless you press Alt
and release it and then press space.

I set winaltkeys to yes but then found some of my mappings were broken so I set it to no and
then used simalt to map the appropriate key sequences to activate the system menu and all the
other menus, however, I found a bug/feature.

The examples show that:

map <M-f> :simalt f<CR>

will display the File menu when winaltkeys is set to no. This works when you haven't got caps
lock on. To get around this I need to have 2 mappings for one key to catch both key states.

Does anyone know a way round this without having 2 mappings, one for each case? Is this
a bug that would need to be fixed or is it something that I'm going to have to live with?

Cheers,

Lee
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
Sponsored by Web Concept Group Inc. SourceForge Logo