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

Re: language-mapping is not applied to macro

Expand Messages
  • Tony Mechelynck
    ... Oh, but what is the difference between :lmap and :lnoremap then? Under :help :lmap , I read: ôThe result, including {rhs}, is then further scanned for
    Message 1 of 14 , Aug 3, 2013
    • 0 Attachment
      On 03/08/13 21:57, Bram Moolenaar wrote:
      >
      > Ron Aaron wrote:
      >
      >> On Friday, August 2, 2013 9:16:41 PM UTC+3, Bram Moolenaar wrote:
      >>> Ron Aaron wrote:
      >>
      >>>
      >>> :lmap is only for typed characters. From the help:
      >>
      >> No, that's not my problem. I'm attaching a file which demonstrates
      >> the exact problem, if you do "gvim -u test.vim", and then in insert
      >> mode type the "'" (single-quote) character, you will get a message.
      >> If you then type ":HebrewWin" and type the 'w' character (which is
      >> lmapped to "'" on a Hebrew keyboard) you will see the single-quote,
      >> but no message. Similarly if you type a single-quote (which gives you
      >> a comma), you get no message.
      >
      > It appears you expect lmap's to be remappable. If you look at the
      > output of ":lmap" you can see they are listed with a star, which means
      > they are not remappable.

      Oh, but what is the difference between :lmap and :lnoremap then? Under
      ":help :lmap", I read: “The result, including {rhs}, is then further
      scanned for mappings.” which would make me believe that :lmap is
      remappable (and that :lnoremap is not).

      However, this ought not even to come into play here, since the problem
      is not about scanning (or not) the {rhs} of the :lmap, but the output of
      @a. Under ":help @" it is said: “The register is executed like a
      mapping, that means that the difference between 'wildchar' and
      'wildcharm' applies.” What it doesn't say is that it is executed like a
      _non-remappable_ mapping, which seems to be the case: when 'iminsert' is
      1, [ typed at the keyboard appears as {{{ (the :lmap has been triggered)
      but [ input by executing @a remains [ (it hasn't).

      >
      > The problem wht remapping is that you nearly always get a recursive
      > sequence, since the character that :lmap maps to usually is lmap'ped to
      > something else.
      >
      > Solving this would require another kind of mapping: don't allow :lmap
      > remapping but do allow other remapping.

      That already exists (but doesn't work, see above): "don't allow lnoremap
      (or keymap lines) remapping but do allow lmap remapping".


      Best regards,
      Tony.
      --
      Give me the Luxuries, and the Hell with the Necessities!

      --
      --
      You received this message from the "vim_dev" 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_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Andy Wokula
      ... Yes. Old discussion comes up again. Try attached patch. (note ff=dos) (not sure if it can be applied to current sources, but it s very short). It makes
      Message 2 of 14 , Aug 4, 2013
      • 0 Attachment
        Am 04.08.2013 05:29, schrieb Ron Aaron:
        > On Saturday, August 3, 2013 10:57:29 PM UTC+3, Bram Moolenaar wrote:
        >
        >> It appears you expect lmap's to be remappable. If you look at the output of
        >> ":lmap" you can see they are listed with a star, which means they are not
        >> remappable.
        >
        > No, I expect that if I map "'" to something, then that mapping will be
        > in effect even if I change the keymap.
        >
        > I expect that an insert-mode mapping operates on the inserted
        > character, in this case "'". It does not (or rather it does but not
        > when an lmap is active), which is counter-intuitive. I think I am not
        > alone in being surprised by this (and I've been using vim for a
        > really, really long time... I just rarely use "imap")
        >
        > At the least, it seems to me that there needs to be a way to have
        > "imap" work as expected when there is an active "lmap".

        Yes. Old discussion comes up again.
        Try attached patch.
        (note ff=dos)
        (not sure if it can be applied to current sources, but it's very short).

        It makes :loadkeymap use :lmap instead of :lnoremap. For over a year I
        didn't get an endless loop with it. And I don't expect endless loops,
        because lmaps are remapped to imaps (rather than lmaps).

        --
        Andy

        --
        --
        You received this message from the "vim_dev" 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_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Ron Aaron
        Thank you, Andy -- that patch does exactly what I want. Bram, will you incorporate it? Thanks! ... -- -- You received this message from the vim_dev maillist.
        Message 3 of 14 , Aug 4, 2013
        • 0 Attachment
          Thank you, Andy -- that patch does exactly what I want.

          Bram, will you incorporate it?

          Thanks!

          On 08/04/2013 02:15 PM, Andy Wokula wrote:
          >
          > Yes. Old discussion comes up again.
          > Try attached patch.
          > (note ff=dos)
          > (not sure if it can be applied to current sources, but it's very short).
          >
          > It makes :loadkeymap use :lmap instead of :lnoremap. For over a year I
          > didn't get an endless loop with it. And I don't expect endless loops,
          > because lmaps are remapped to imaps (rather than lmaps).
          >

          --
          --
          You received this message from the "vim_dev" 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_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Bram Moolenaar
          ... Yeah, that s what I meant, that loadkeymap doesn t allow remapping. And :lamp shows the start to indicate that s what happens. It has always been that
          Message 4 of 14 , Aug 4, 2013
          • 0 Attachment
            Andy Wokula wrote:

            > Am 04.08.2013 05:29, schrieb Ron Aaron:
            > > On Saturday, August 3, 2013 10:57:29 PM UTC+3, Bram Moolenaar wrote:
            > >
            > >> It appears you expect lmap's to be remappable. If you look at the output of
            > >> ":lmap" you can see they are listed with a star, which means they are not
            > >> remappable.
            > >
            > > No, I expect that if I map "'" to something, then that mapping will be
            > > in effect even if I change the keymap.
            > >
            > > I expect that an insert-mode mapping operates on the inserted
            > > character, in this case "'". It does not (or rather it does but not
            > > when an lmap is active), which is counter-intuitive. I think I am not
            > > alone in being surprised by this (and I've been using vim for a
            > > really, really long time... I just rarely use "imap")
            > >
            > > At the least, it seems to me that there needs to be a way to have
            > > "imap" work as expected when there is an active "lmap".
            >
            > Yes. Old discussion comes up again.
            > Try attached patch.
            > (note ff=dos)
            > (not sure if it can be applied to current sources, but it's very short).
            >
            > It makes :loadkeymap use :lmap instead of :lnoremap. For over a year I
            > didn't get an endless loop with it. And I don't expect endless loops,
            > because lmaps are remapped to imaps (rather than lmaps).

            Yeah, that's what I meant, that loadkeymap doesn't allow remapping.
            And ":lamp" shows the start to indicate that's what happens.

            It has always been that way. When changing this the users who want
            remapping to work (the ones involved in this discussion) will be happy,
            and another set of users (who are not yeet involved, since they are
            currently happy) will have a problem, since the meaning of their
            mappings change. That is, they only want them to apply for the actually
            typed key, not what a keymap results in.

            I don't know how many users are in one group or the other, but I
            definitely don't want to make an incompatible change so short before a
            release.

            How about this: If you want the langmaps to be remappable, then after
            setting the keymap option, you manually use an :lmap for those
            characters you want to be remappable. Can't be that many.

            What I previously said abuot a recursive mapping was wrong, lmap's only
            appy to typed characters, thus that can't happen within lmap's
            themselves.


            --
            hundred-and-one symptoms of being an internet addict:
            42. Your virtual girlfriend finds a new net sweetheart with a larger bandwidth.

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
            \\\ an exciting new programming language -- http://www.Zimbu.org ///
            \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

            --
            --
            You received this message from the "vim_dev" 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_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Ron Aaron
            ... How about discussing how it should work logically? Does an iab of a to joe work with a keymap set? Yes, it does. Does an imap of a to whatever
            Message 5 of 14 , Aug 4, 2013
            • 0 Attachment
              On Sunday, August 4, 2013 5:24:44 PM UTC+3, Bram Moolenaar wrote:

              > It has always been that way. When changing this the users who want remapping
              > to work (the ones involved in this discussion) will be happy, and another set
              > of users (who are not yeet involved, since they are currently happy) will
              > have a problem, since the meaning of their mappings change. That is, they
              > only want them to apply for the actually typed key, not what a keymap results
              > in.

              How about discussing how it should work logically?

              Does an "iab" of "'a" to "joe" work with a keymap set? Yes, it does.

              Does an "imap" of "'a" to whatever work? No, it doesn't.

              Why this inconsistency? It serves no purpose.

              > How about this: If you want the langmaps to be remappable, then after
              > setting the keymap option, you manually use an :lmap for those
              > characters you want to be remappable. Can't be that many.

              Can you make my attached 'test.vim' work with 'lmap' so that the single-quote works as most anyone would expect, e.g. the same, with and without a keymap? I could not.

              To clarify: I do not want to remap the keymap'ed keyboard. I want a "'" pressed on the normal keyboard, and the keymap'ed character ("w", on the Hebrew map) to have the same effect in an imap. I think that is an entirely normal thing to expect, e.g. consistent behavior.

              I never thought when I originally put the keymap functionality in vim (12 years ago?) that an insert map would be disabled just because a keymap was enabled.

              --
              --
              You received this message from the "vim_dev" 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_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Yukihiro Nakadaira
              ... I think those two problem is slightly different. Tyru s problem is that it is not possible to record and repeat insertion using lmap. -- Yukihiro
              Message 6 of 14 , Aug 16, 2013
              • 0 Attachment
                On Fri, Aug 2, 2013 at 11:33 PM, Ron Aaron <ronware.org@...> wrote:
                Perhaps this is related to the bug I reported with Hebrew keymap, some "imap" doesn't work.

                I think those two problem is slightly different.  Tyru's problem is that
                it is not possible to record and repeat insertion using lmap.

                --
                Yukihiro Nakadaira - yukihiro.nakadaira@...

                --
                --
                You received this message from the "vim_dev" 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_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              Your message has been successfully submitted and would be delivered to recipients shortly.