2

When I have to work on Windows I have the habit to reduce my windows with the key combo Alt-Space+u (Alt-Space will pop the window menu and u is the shortcut to minimize the window and may change depending on the language of your system).

This is pretty useful but Vim takes control of all Alt- combinations, to increase the number of possible mappings which prevent me from using this combination.

How can I do to use Alt-Space-u to reduce gVim in Windows?

3

(I actually found a solution while writing my question and thought it could be useful to other people)

According to :h 'winaltkeys' setting winaltkeys to yes should tell Vim to let the windowing system handle the combinations of alt and another key (setting it to menu should tell Vim to let the windowing system handle Alt + a menu key). Unfortunately for a reason that I ignore, this option still doesn't let me use Alt+Space on Windows. So I found another option:

It is possible to create the following mapping:

nnoremap <M-Space> :simalt ~<CR>

The simalt command allows Vim to fake a Windows-style Alt keypress. This way when I press Alt-Space I get this convenient pop up menu and I then can press u to reduce my gVim Window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.