Loading ...
Sorry, an error occurred while loading the content.
 

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

Expand Messages
  • jason heddings
    I find that I am able to access the menu by doing then instead of , which I m guessing Vim intercepts for the purpose of remapping... Not
    Message 1 of 8 , Oct 1, 2005
      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:mbryan2@...]
      Sent: Saturday, 01 October, 2005 13:30
      To: vim@...
      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
    • Georg Dahn
      Hi! It works for me, thus it might be some configuration in your .vimrc file which prevents it from working. (That is, both - and typing and
      Message 2 of 8 , Oct 1, 2005
        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
      • Tim Chase
        ... 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
        Message 3 of 8 , Oct 1, 2005
          > 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
        • Tim Chase
          ... ...and to minimize the GUI, the instructions are in the paragraph following the one I quoted, found at :help simalt ... -tim
          Message 4 of 8 , Oct 1, 2005
            > 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
          • Mike Bryan
            Jason, yes I am able to use then and that does work. I guess I had never tried it that way before. Tim, your suggestion of adding this command to
            Message 5 of 8 , Oct 1, 2005
              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 <vim@...> 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
            • A. J. Mechelynck
              ... 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
              Message 6 of 8 , Oct 2, 2005
                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.
              • adah@netstd.com
                ... 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,
                Message 7 of 8 , Oct 7, 2005
                  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
                Your message has been successfully submitted and would be delivered to recipients shortly.