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

Re: ":map" vs. ":map!" (was "Problem inserting '%' in vim")

Expand Messages
  • Tony Mechelynck
    ... Sorry for waking up an old thread; I m really behind in reading my mail. I think the fundamental difference between :map and :map! is that :map!
    Message 1 of 12 , Apr 29, 2009
    • 0 Attachment
      On 22/04/09 17:42, Tim Chase wrote:
      >
      > Matt Wozniski wrote:
      >>> I read up at
      >>>
      >>> :help mapmode-ic
      >>> and just above the help for
      >>> :help :map_l
      >>> but neither details the difference between the two.
      >>
      >> Check out :help map-modes
      >
      > I've reread that section a third time (it's just above the
      > "mapmode-ic" I had already read), and it takes seeing all three
      > tables/sections (mapmode-nvo, mapmode-ic, and mapmode-x) as
      > interrelated and mutually exclusive to discern "
      >
      >> :map lists normal, visual, select, and operator pending mappings,
      >> :map! lists insert, command line, and language mappings.
      >
      > " from that. It might help to tweak the brief text at "help
      > map-modes" to mention all three sections together to group them
      > conceptually:
      >
      > Overview of which map command works in which mode:
      > |mapmode-nvo|, |mapmode-x|, |mapmode-ic|
      >
      > (as an aside, it looks like there should be a help-target for
      > "mapmode-xs" to follow the pattern of the other groupings)
      >
      > Thanks for pointing me to the bigger-picture structure of that
      > section.
      >
      > -tim
      >

      Sorry for waking up an old thread; I'm really behind in reading my mail.

      I think the fundamental difference between ":map" and ":map!" is that
      ":map!" (with exclamation mark) applies to modes (Insert/Replace and
      Command-line) where letters, digits and punctuation are _typed_ as
      letters, digits and punctuation (either into a buffer or on the
      command-line) while ":map" (with no exclamation mark) applies to modes
      where letters etc. are commands for various actions, motions, objects,
      etc., but not characters to be typed (Normal, Visual and Operator-pending).


      Best regards,
      Tony.
      --
      Probably the question asked most often is: Do one-celled animals have
      orgasms? The answer is yes, they have orgasms almost constantly, which
      is why they don't mind living in pools of warm slime.
      -- Dave Barry, "Sex and the Single Amoeba: What Every
      Teen Should Know"

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Yegappan Lakshmanan
      Hi, On Wed, Apr 29, 2009 at 4:37 PM, Tony Mechelynck ... The various aspects of mapping keys in Vim is explained in detail in the following pages:
      Message 2 of 12 , Apr 29, 2009
      • 0 Attachment
        Hi,

        On Wed, Apr 29, 2009 at 4:37 PM, Tony Mechelynck
        <antoine.mechelynck@...> wrote:
        >
        > On 22/04/09 17:42, Tim Chase wrote:
        >>
        >> Matt Wozniski wrote:
        >>>> I read up at
        >>>>
        >>>>    :help mapmode-ic
        >>>> and just above the help for
        >>>>    :help :map_l
        >>>> but neither details the difference between the two.
        >>>
        >>> Check out :help map-modes
        >>
        >> I've reread that section a third time (it's just above the
        >> "mapmode-ic" I had already read), and it takes seeing all three
        >> tables/sections (mapmode-nvo, mapmode-ic, and mapmode-x) as
        >> interrelated and mutually exclusive to discern "
        >>
        >>> :map lists normal, visual, select, and operator pending mappings,
        >>> :map! lists insert, command line, and language mappings.
        >>
        >> " from that.  It might help to tweak the brief text at "help
        >> map-modes" to mention all three sections together to group them
        >> conceptually:
        >>
        >>     Overview of which map command works in which mode:
        >>      |mapmode-nvo|, |mapmode-x|, |mapmode-ic|
        >>
        >> (as an aside, it looks like there should be a help-target for
        >> "mapmode-xs" to follow the pattern of the other groupings)
        >>
        >> Thanks for pointing me to the bigger-picture structure of that
        >> section.
        >>
        >> -tim
        >>
        >
        > Sorry for waking up an old thread; I'm really behind in reading my mail.
        >
        > I think the fundamental difference between ":map" and ":map!" is that
        > ":map!" (with exclamation mark) applies to modes (Insert/Replace and
        > Command-line) where letters, digits and punctuation are _typed_ as
        > letters, digits and punctuation (either into a buffer or on the
        > command-line) while ":map" (with no exclamation mark) applies to modes
        > where letters etc. are commands for various actions, motions, objects,
        > etc., but not characters to be typed (Normal, Visual and Operator-pending).
        >

        The various aspects of mapping keys in Vim is explained in detail in
        the following pages:

        http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_1)
        http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_2)
        http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_3)

        - Yegappan

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      Your message has been successfully submitted and would be delivered to recipients shortly.