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

Re: Alt key mapping trouble under windows XP

Expand Messages
  • A.J.Mechelynck
    ... The Alt key, like the Ctrl key or the Shift key, should do nothing until you press another key together with it. If it produces an action as soon as you
    Message 1 of 5 , Jun 4, 2006
    • 0 Attachment
      Eyal Raab wrote:
      > Hi,
      >
      > I'm using VIM 7.0 under windows XP.
      > I'm trying to define some alt key bindings and I can't seem to succeed.
      >
      > The trouble I'm having is that as soon as I press the ALT key, it jumps
      > to the menu, even if I have:
      > set winaltkeys=menu or
      > set winaltkeys=no
      >
      > I've looked around the web and the VIM book for a while and I couldn't
      > see anyone referring to this problem.
      >
      > Did anyone come accross this problem or can help me?
      >
      > What I'm trying to do is to keep using the h,j,k,l in insert mode by
      > mapping the alt-key to them.
      > Something like:
      > :map <M-j> <esc>ji
      >
      > I'm using the ALT key since it's a very convenient key on my ergonomic
      > keyboard.
      >
      > Any help would be greatly appreciated.
      >
      > Eyal Raab.
      >
      >
      >
      >
      The Alt key, like the Ctrl key or the Shift key, should do nothing until
      you press another key together with it. If it produces an action "as
      soon as" you press it, even all by itself, then there is a problem with
      your keyboard interface, not with Vim. Maybe it's under "Control Panel
      -> Keyboard", maybe elsewhere, Bill Gates's minions have a talent for
      making important settings hard to find, and I don't have a Windows box
      at hand at the moment. Good luck!

      Or maybe you are hitting the Menu key rather than the Alt key? On my
      Belgian AZERTY keyboard, the Alt key is immediately to the left of the
      spacebar, and the Menu key is next to the right-Ctrl key.


      Best regards,
      Tony.
    • Gerald Lai
      ... [snip] ... [snip] ... This should do what you want: inoremap inoremap inoremap inoremap See :help
      Message 2 of 5 , Jun 4, 2006
      • 0 Attachment
        On Sun, 4 Jun 2006, Eyal Raab wrote:

        > Hi,
        >
        > I'm using VIM 7.0 under windows XP.
        [snip]
        > What I'm trying to do is to keep using the h,j,k,l in insert mode by
        > mapping the alt-key to them.
        > Something like:
        > :map <M-j> <esc>ji
        [snip]

        :map does not include Insert mode mapping. See ":help map-modes".

        This should do what you want:

        inoremap <M-h> <Left>
        inoremap <M-j> <Down>
        inoremap <M-k> <Up>
        inoremap <M-l> <Right>

        See ":help imap".

        HTH :)
        --
        Gerald
      • A.J.Mechelynck
        ... I don t know, I don t even know what a Microsoft Ergonomic Keyboard looks like. I ve always used plain rectangular AZERTY keyboards (with a few more keys
        Message 3 of 5 , Jun 4, 2006
        • 0 Attachment
          Eyal Raab wrote:
          > Hi Tony,
          >
          > Thanks for the quick reply.
          > Mabye could it be something with my new Microsoft Ergonomic keyboard?
          >
          > I'll look into it.
          > Eyal.
          >
          >
          I don't know, I don't even know what a "Microsoft Ergonomic Keyboard"
          looks like. I've always used plain rectangular AZERTY keyboards (with a
          few more keys than a hundred) and I'm not gonna change.


          Best regards,
          Tony.
        • Eyal Raab
          Hi, I m using VIM 7.0 under windows XP. I m trying to define some alt key bindings and I can t seem to succeed. The trouble I m having is that as soon as I
          Message 4 of 5 , Jun 4, 2006
          • 0 Attachment
            Hi,

            I'm using VIM 7.0 under windows XP.
            I'm trying to define some alt key bindings and I can't seem to succeed.

            The trouble I'm having is that as soon as I press the ALT key, it jumps
            to the menu, even if I have:
            set winaltkeys=menu or
            set winaltkeys=no

            I've looked around the web and the VIM book for a while and I couldn't
            see anyone referring to this problem.

            Did anyone come accross this problem or can help me?

            What I'm trying to do is to keep using the h,j,k,l in insert mode by
            mapping the alt-key to them.
            Something like:
            :map <M-j> <esc>ji

            I'm using the ALT key since it's a very convenient key on my ergonomic
            keyboard.

            Any help would be greatly appreciated.

            Eyal Raab.
          • Eyal Raab
            Hi Tony, Thanks for the quick reply. Mabye could it be something with my new Microsoft Ergonomic keyboard? I ll look into it. Eyal. ... From: A.J.Mechelynck
            Message 5 of 5 , Jun 4, 2006
            • 0 Attachment
              Hi Tony,

              Thanks for the quick reply.
              Mabye could it be something with my new Microsoft Ergonomic keyboard?

              I'll look into it.
              Eyal.

              -----Original Message-----
              From: A.J.Mechelynck [mailto:antoine.mechelynck@...]
              Sent: Sunday, June 04, 2006 9:30 AM
              To: Eyal Raab
              Cc: vim@...
              Subject: Re: Alt key mapping trouble under windows XP

              Eyal Raab wrote:
              > Hi,
              >
              > I'm using VIM 7.0 under windows XP.
              > I'm trying to define some alt key bindings and I can't seem to
              succeed.
              >
              > The trouble I'm having is that as soon as I press the ALT key, it
              > jumps to the menu, even if I have:
              > set winaltkeys=menu or
              > set winaltkeys=no
              >
              > I've looked around the web and the VIM book for a while and I couldn't

              > see anyone referring to this problem.
              >
              > Did anyone come accross this problem or can help me?
              >
              > What I'm trying to do is to keep using the h,j,k,l in insert mode by
              > mapping the alt-key to them.
              > Something like:
              > :map <M-j> <esc>ji
              >
              > I'm using the ALT key since it's a very convenient key on my ergonomic

              > keyboard.
              >
              > Any help would be greatly appreciated.
              >
              > Eyal Raab.
              >
              >
              >
              >
              The Alt key, like the Ctrl key or the Shift key, should do nothing until
              you press another key together with it. If it produces an action "as
              soon as" you press it, even all by itself, then there is a problem with
              your keyboard interface, not with Vim. Maybe it's under "Control Panel
              -> Keyboard", maybe elsewhere, Bill Gates's minions have a talent for
              making important settings hard to find, and I don't have a Windows box
              at hand at the moment. Good luck!

              Or maybe you are hitting the Menu key rather than the Alt key? On my
              Belgian AZERTY keyboard, the Alt key is immediately to the left of the
              spacebar, and the Menu key is next to the right-Ctrl key.


              Best regards,
              Tony.
            Your message has been successfully submitted and would be delivered to recipients shortly.