why can't I access the sys menu to minimize gvim window using the keyboard?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

why can't I access the sys menu to minimize gvim window using the keyboard?

Mike Bryan
I've been using gvim for years and this is one thing I've never been able to
figure out.

In Windows you can generally hit Alt-spacebar in an app to get the
system menu to drop down. This works in a DOS window, 4NT window and
just about any other Windows app I've tried. However, it doesn't work
with gvim (currently using 6.3).

The Alt-spacebar key combination seems to be ignored by gvim.

I am able to quickly minimize the current window I'm working in with
this key combination:
          Alt-spacebar +N
This doesn't work with gvim on Windows and I can't find any way to do
it with a vim command either.

Am I missing something obvious?

thanks!
-mike

OS: Windows XP Pro
gvim: 6.3.67
Reply | Threaded
Open this post in threaded view
|

RE: why can't I access the sys menu to minimize gvim window using the keyboard?

jason heddings-2
I find that I am able to access the menu by doing <Alt> then <Space> instead
of <A-S>, which I'm guessing Vim intercepts for the purpose of remapping...

Not sure if there is a vim command to access the system menu or to minimize
the GUI.

--jah
 

-----Original Message-----
From: Mike Bryan [mailto:[hidden email]]
Sent: Saturday, 01 October, 2005 13:30
To: [hidden email]
Subject: why can't I access the sys menu to minimize gvim window using the
keyboard?

I've been using gvim for years and this is one thing I've never been able to
figure out.

In Windows you can generally hit Alt-spacebar in an app to get the system
menu to drop down. This works in a DOS window, 4NT window and just about any
other Windows app I've tried. However, it doesn't work with gvim (currently
using 6.3).

The Alt-spacebar key combination seems to be ignored by gvim.

I am able to quickly minimize the current window I'm working in with this
key combination:
          Alt-spacebar +N
This doesn't work with gvim on Windows and I can't find any way to do it
with a vim command either.

Am I missing something obvious?

thanks!
-mike

OS: Windows XP Pro
gvim: 6.3.67



Reply | Threaded
Open this post in threaded view
|

Re: why can't I access the sys menu to minimize gvim window using the keyboard?

Tim Chase-2
In reply to this post by Mike Bryan
> The Alt-spacebar key combination seems to be ignored by gvim.
>
> I am able to quickly minimize the current window I'm working in with
> this key combination:
>           Alt-spacebar +N
> This doesn't work with gvim on Windows and I can't find any way to do
> it with a vim command either.
>
> Am I missing something obvious?

I'm not sure it qualifies as "obvious", but it is a vim
peculiarity.  Vim does indeed see the alt+space.  However, it's
available for other mappings.  Your answer is found in the
"simalt" section of the help:

        :help simalt

where you'll find

        :map <M-Space> :simalt ~<CR>
    This maps Alt-Space to pop down the system menu for the
    Vim window. Note that ~ is used by simalt to represent
    the <Space> character.

If you put that mapping in your vimrc file (verbatim, with the
tilde and "<" and ">" signs), it should restore the expected
functionality.

-tim




Reply | Threaded
Open this post in threaded view
|

Re: why can't I access the sys menu to minimize gvim window using the keyboard?

Tim Chase-2
In reply to this post by jason heddings-2
> Not sure if there is a vim command to access the system menu
> or to minimize the GUI.

...and to minimize the GUI, the instructions are in the paragraph
following the one I quoted, found at ":help simalt"

:)

-tim




Reply | Threaded
Open this post in threaded view
|

Re: why can't I access the sys menu to minimize gvim window using the keyboard?

Georg Dahn
In reply to this post by Mike Bryan
Hi!

It works for me, thus it might be some configuration in your .vimrc file
which prevents it from working. (That is, both <Alt>-<Space> and typing
<Alt> and then <Space> work for me.)

Best regards,
Georg



Mike Bryan wrote:

>I've been using gvim for years and this is one thing I've never been able to
>figure out.
>
>In Windows you can generally hit Alt-spacebar in an app to get the
>system menu to drop down. This works in a DOS window, 4NT window and
>just about any other Windows app I've tried. However, it doesn't work
>with gvim (currently using 6.3).
>
>The Alt-spacebar key combination seems to be ignored by gvim.
>
>I am able to quickly minimize the current window I'm working in with
>this key combination:
>          Alt-spacebar +N
>This doesn't work with gvim on Windows and I can't find any way to do
>it with a vim command either.
>
>Am I missing something obvious?
>
>thanks!
>-mike
>
>OS: Windows XP Pro
>gvim: 6.3.67
>
>  
>

       
       
               
___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: why can't I access the sys menu to minimize gvim window using the keyboard?

Mike Bryan
In reply to this post by Tim Chase-2
Jason,
yes I am able to use <Alt> then <Space> and that does work. I guess I
had never tried it that way before.

Tim, your suggestion of adding this command to my _vimrc file gives me
exactly what I want!
:map <M-Space> :simalt ~<CR>

I also added this command, and now a simple Ctrl-M minimizes my vim window;
:map <C-m> :simalt ~n<CR>

Thanks everyone! I appreciate the responses, this all helps a lot.

-mike


On 10/1/05, Tim Chase <[hidden email]> wrote:

> I'm not sure it qualifies as "obvious", but it is a vim
> peculiarity.  Vim does indeed see the alt+space.  However, it's
> available for other mappings.  Your answer is found in the
> "simalt" section of the help:
>
>        :help simalt
>
> where you'll find
>
>        :map <M-Space> :simalt ~<CR>
>    This maps Alt-Space to pop down the system menu for the
>    Vim window. Note that ~ is used by simalt to represent
>    the <Space> character.
>
> If you put that mapping in your vimrc file (verbatim, with the
> tilde and "<" and ">" signs), it should restore the expected
> functionality.
>
> -tim
Reply | Threaded
Open this post in threaded view
|

Re: why can't I access the sys menu to minimize gvim window using the keyboard?

A.J.Mechelynck
In reply to this post by Mike Bryan
Mike Bryan wrote:

> I've been using gvim for years and this is one thing I've never been able to
> figure out.
>
> In Windows you can generally hit Alt-spacebar in an app to get the
> system menu to drop down. This works in a DOS window, 4NT window and
> just about any other Windows app I've tried. However, it doesn't work
> with gvim (currently using 6.3).
>
> The Alt-spacebar key combination seems to be ignored by gvim.
>
> I am able to quickly minimize the current window I'm working in with
> this key combination:
>           Alt-spacebar +N
> This doesn't work with gvim on Windows and I can't find any way to do
> it with a vim command either.
>
> Am I missing something obvious?
>
> thanks!
> -mike
>
> OS: Windows XP Pro
> gvim: 6.3.67

The setting of 'winaltkeys' may have an influence on whether or not
Alt-Space is recognise. My W32 gvim doesn't open the Control menu on
Alt-Space with 'winaltkeys' set to "menu".

":simalt ~" (without the quotes, and W32 only) opens the Control menu.
However that menu's accelerator keys are language-dependent. "Restore",
for instance, would be ":simalt ~r" (&Restore) on your English-language
Windows, but it is ":simalt ~v" (&Vorig formaat) on my Dutch one.

To minimize the gvim window in a portable way, use the ":sus[pend]"
command. To maximize it (or almost), use ":set lines=9999 columns=9999".
To move and/or resize it, use the ":winpos" command and/or set the
'lines' and 'columns' options. The current values of the options can be
read as &lines and &columns, and the position can be read as
getwinposx() and getwinposy().

See
        :help 'winaltkeys'
        :help :simalt
        :help :suspend
        :help :winpos
        :help getwinposx()
        :help getwinposy()
        :help 'lines'
        :help 'columns'


HTH,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: why can't I access the sys menu to minimize gvim window using the keyboard?

adah
In reply to this post by Mike Bryan
Mike Bryan wrote:
> I am able to quickly minimize the current window I'm working in with
> this key combination:
>           Alt-spacebar +N
> This doesn't work with gvim on Windows and I can't find any way to do
> it with a vim command either.
>
> Am I missing something obvious?

It seems you did not source mswin.vim.  Though some buddies here do not
like it, I do use it and feel that it makes Vim more Windows-like.

Specifically, mswin.vim has the following lines:

" Alt-Space is System menu
if has("gui")
  noremap <M-Space> :simalt ~<CR>
  inoremap <M-Space> <C-O>:simalt ~<CR>
  cnoremap <M-Space> <C-C>:simalt ~<CR>
endif

You should at least have the interest to look at it to see whether there
are more useful things in it.  It gives you familiar mappings like
<Ctrl-Tab>, <Ctrl-F4>, <Ctrl-A>, <Ctrl-Z>, and controversial ones like
<Ctrl-V>, <Ctrl-Y>.

Best regards,

Yongwei