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

imap Alt Space (please help <:( )

Expand Messages
  • neolus
    Hello, I simply wanted to redirect Alt + Space in insert mode to a plain space but this seems more complicated than I thought. I ve only tried i[nore]map
    Message 1 of 6 , Jun 25 6:11 AM
    • 0 Attachment
      Hello, I simply wanted to redirect Alt + Space in insert mode to a plain
      space
      but this seems more complicated than I thought.

      I've only tried i[nore]map <A-Space> <Space>
      (or w/ imap <M-Space> <Space>)

      but the same behaviour that it its always given me remains.
      e.g. in insert I type Alt + Space & my input is grabbed untill I press one
      more key
      like say Alt + Space, F2 will print <80>

      I really hope there's a way, and I hope somebody out there has an idea ?
      I already searched alot for this but can't seem to find anyone else w/ the
      same problem/need.
      Thanks in advance if you're reading this !
      Cheers !



      --
      View this message in context: http://vim.1045645.n5.nabble.com/imap-Alt-Space-please-help-tp5721993.html
      Sent from the Vim - General mailing list archive at Nabble.com.

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Bruno Sutic
      Hey, I ve tried to make a plugin that consistently enables alt mappings in vim. https://github.com/bruno-/vim-alt-mappings It turns our that s a though problem
      Message 2 of 6 , Jun 25 8:25 AM
      • 0 Attachment
        Hey,
        I've tried to make a plugin that consistently enables alt mappings in vim.
        https://github.com/bruno-/vim-alt-mappings

        It turns our that's a though problem for command line vim - mostly because enabling alt mappings breaks a lot of other stuff.

        But anyway - can you post which vim are you using (command line, gui)?
        Also, if it's terminal vim, then can you please post terminal (Terminal.all in OSX, iTerm, or something else)?

        On Wednesday, June 25, 2014 3:29:38 PM UTC+2, neolus wrote:
        > Hello, I simply wanted to redirect Alt + Space in insert mode to a plain
        >
        > space
        >
        > but this seems more complicated than I thought.
        >
        >
        >
        > I've only tried i[nore]map <A-Space> <Space>
        >
        > (or w/ imap <M-Space> <Space>)
        >
        >
        >
        > but the same behaviour that it its always given me remains.
        >
        > e.g. in insert I type Alt + Space & my input is grabbed untill I press one
        >
        > more key
        >
        > like say Alt + Space, F2 will print <80>
        >
        >
        >
        > I really hope there's a way, and I hope somebody out there has an idea ?
        >
        > I already searched alot for this but can't seem to find anyone else w/ the
        >
        > same problem/need.
        >
        > Thanks in advance if you're reading this !
        >
        > Cheers !
        >
        >
        >
        >
        >
        >
        >
        > --
        >
        > View this message in context: http://vim.1045645.n5.nabble.com/imap-Alt-Space-please-help-tp5721993.html
        >
        > Sent from the Vim - General mailing list archive at Nabble.com.

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • neolus
        my bad, I m using gvim 7.4.335-4 -- View this message in context: http://vim.1045645.n5.nabble.com/imap-Alt-Space-please-help-tp5721993p5721996.html Sent from
        Message 3 of 6 , Jun 25 12:03 PM
        • 0 Attachment
          my bad, I'm using gvim 7.4.335-4




          --
          View this message in context: http://vim.1045645.n5.nabble.com/imap-Alt-Space-please-help-tp5721993p5721996.html
          Sent from the Vim - General mailing list archive at Nabble.com.

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        • Michael Henry
          ... I see from a later post that you re running gvim. Normally that makes mapping keys fairly straightforward, but mapping alt-space seems to be an anomaly,
          Message 4 of 6 , Jun 25 5:52 PM
          • 0 Attachment
            > On Wednesday, June 25, 2014 3:29:38 PM UTC+2, neolus wrote:
            >> Hello, I simply wanted to redirect Alt + Space in insert mode to a plain
            >> space but this seems more complicated than I thought.

            I see from a later post that you're running gvim. Normally that
            makes mapping keys fairly straightforward, but mapping alt-space
            seems to be an anomaly, at least for me running Gvim under KDE
            on Linux. I usually have alt-space mapped for a system-wide
            function, so I'd never tried mapping it in Gvim before. I get
            the same behavior as you. A common way to determine which codes
            are sent by pressing a key is to enter insert mode, press Ctrl-V
            (or Ctrl-Q if you've got Ctrl-V mapped, which is sometimes done
            on Microsoft Windows), then press the key in question. It
            should insert its key code into the buffer for examination.
            When I try this with alt-space, nothing happens until I press
            another key. I think this means you may not have much success
            trying to map alt-space in Gvim, at least without a more
            thorough look into Gvim's guts to see what's going on under the
            hood.

            On 06/25/2014 11:25 AM, Bruno Sutic wrote:
            > I've tried to make a plugin that consistently enables alt mappings in vim.
            > https://github.com/bruno-/vim-alt-mappings

            Hi, Bruno,

            I took a quick look at your plugin page, and I see you've got it
            marked "experimental" because of some unsolved issues. You
            might like to take a look at my "fixkey" plugin to see how it
            handles some of the issues you bring up:
            https://github.com/drmikehenry/vim-fixkey

            Michael Henry

            --
            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.
          • John Little
            Alt-whatever often belongs to the DE, and alt-space is used by windows and gnome at least; so, what OS? and desktop environment if linux? Regards, John Little
            Message 5 of 6 , Jun 25 11:03 PM
            • 0 Attachment
              Alt-whatever often belongs to the DE, and alt-space is used by windows and gnome at least; so, what OS? and desktop environment if linux?

              Regards, John Little

              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/d/optout.
            • Michael Henry
              ... In my case, I m running Linux (Fedora 20) and KDE. While mostly I configure KDE such that alt-space opens the window operations menu (to match the
              Message 6 of 6 , Jun 26 4:49 AM
              • 0 Attachment
                On 06/26/2014 02:03 AM, John Little wrote:
                > Alt-whatever often belongs to the DE, and alt-space is used by
                > windows and gnome at least; so, what OS? and desktop
                > environment if linux?

                In my case, I'm running Linux (Fedora 20) and KDE. While mostly
                I configure KDE such that alt-space opens the window operations
                menu (to match the equivalent behavior in Windows), I unmapped
                this key for my Vim tests. In that environment, I can run gvim
                and enter insert mode. When I press alt-space once, nothing
                visible happens. Pressing alt-space again yields the following
                character inserted into the buffer: Â

                Using a unicode decoder, I see this is Unicode code point
                U+00C2, "LATIN CAPITAL LETTER A WITH CIRCUMFLEX".

                Testing in a terminal emulator (KDE Konsole), I run:

                cat

                then press alt-space. As with other alt keys in this terminal,
                alt-space is encoded as an escape character followed by a space
                (<Esc><Space> in Vim's notation). In console Vim, this is in
                fact what I get when I enter insert mode and press alt-space.

                Gvim is a different story, though. I don't really know how keys
                are encoded and received by Gvim, other than to say that
                pressing alt-space twice causes insertion of the "Â" character
                on my system.

                Since the original poster shows similar behavior (pressing
                alt-space appears to do nothing, but following that keypress
                with <F2> causes <80> to be inserted), I suspect alt-space isn't
                mapped to anything outside of Gvim in his environment.

                Michael Henry

                --
                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/d/optout.
              Your message has been successfully submitted and would be delivered to recipients shortly.