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

Re: map ZZ

Expand Messages
  • ZyX
    ... Can’t say whether this behavior is intentional, but it is the consequence of the way how things are implemented. Multicharacter commands like “gg”,
    Message 1 of 5 , Mar 30, 2013
    • 0 Attachment
      > but I wonder is this expected behavior (if ZZ somehow special command) or bug?
      > And if this is expected behavior, then where I can find list of all such
      > special commands to add maps for them all?

      Can’t say whether this behavior is intentional, but it is the consequence of the way how things are implemented. Multicharacter commands like “gg”, “ZZ” should be considered not like one command, but like two commands in different modes: first “g” enters “waiting for next character of multicharacter ‘g’ command” “mode”, next “g” actually does something.

      Implementation really does not switch any modes, it just instead of using something like a list of mapping tables {builtin_commands, global_mappings, local_mappings} special-cases all built-ins and uses plain_vgetc function in C code unconditionally waiting for next character.

      --
      --
      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.
    • Alex Efros
      Hi! ... Maybe I missed something in your explanation, but I still doesn t understand why first Z mapped from Russian char but not second Z. Or special-case
      Message 2 of 5 , Apr 2, 2013
      • 0 Attachment
        Hi!

        On Sat, Mar 30, 2013 at 01:25:07PM -0700, ZyX wrote:
        > Implementation really does not switch any modes, it just instead of
        > using something like a list of mapping tables {builtin_commands,
        > global_mappings, local_mappings} special-cases all built-ins and uses
        > plain_vgetc function in C code unconditionally waiting for next
        > character.

        Maybe I missed something in your explanation, but I still doesn't
        understand why first Z mapped from Russian char but not second Z.
        Or special-case handling begins _after_ entering first Z, so first and
        second Z read by Vim using different implementations? Sounds like a bug.

        Anyway, if no one bothers fixing this, where I can find list of all such
        special-case key combinations, to manually add mapping for them all in my
        plugin?

        --
        WBR, Alex.

        --
        --
        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.
      • ZyX
        ... After first Z it uses plain_vgetc to get next character (which is a special-case because all user mappings use different method). plain_vgetc does not do
        Message 3 of 5 , Apr 2, 2013
        • 0 Attachment
          > > Implementation really does not switch any modes, it just instead of
          > > using something like a list of mapping tables {builtin_commands,
          > > global_mappings, local_mappings} special-cases all built-ins and uses
          > > plain_vgetc function in C code unconditionally waiting for next
          > > character.
          >
          > Maybe I missed something in your explanation, but I still doesn't
          > understand why first Z mapped from Russian char but not second Z.
          > Or special-case handling begins _after_ entering first Z, so first and
          > second Z read by Vim using different implementations? Sounds like a bug.

          After first Z it uses plain_vgetc to get next character (which is a special-case because all user mappings use different method). plain_vgetc does not do any remapping.

          > Anyway, if no one bothers fixing this, where I can find list of all such
          > special-case key combinations, to manually add mapping for them all in my
          > plugin?

          `:h normal-index`. Note that you have to remap also m…/`…/'… (ьф…ья → ma…mz, ьФ…ьЯ → mA…mZ, same for other), @… (accepts A-Z and all other register names in addition to a-z listed in `:h normal-index`), f…/F…/t…/T… (accepts anything), r… (accepts anything), do/dp, maybe something else in addition to commands listed under `:h g`, `:h z` and `:h [`.

          --
          --
          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.