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

Re: apparent bug combining mapping and abbreviations

Expand Messages
  • Bram Moolenaar
    ... Starting with Vim 6.3 abbreviations are not triggered by noremapped keys. This problem was half-fixed by patch 6.3.023 for when the Space key is mapped
    Message 1 of 5 , Oct 3, 2004
    • 0 Attachment
      Moshe Kaminsky wrote:

      > I don't know if this really deserves to be called a bug, but here it is:
      > If I map <Space> in insert mode, abbreviations are not expanded when I
      > press <Space>. For example
      >
      > :inoremap <Space> <Space>
      > :iab st such that
      >
      > The st will not expand after the space.
      >
      > I came across this while editing a latex file with the latex suite,
      > which indeed maps <Space>, but abbreviations did work for me with latex
      > a few months ago, so I believe it is caused by a change introduced
      > during this period.
      >
      > I'm using version 6.3.25 on linux.

      Starting with Vim 6.3 abbreviations are not triggered by "noremapped"
      keys.

      This problem was half-fixed by patch 6.3.023 for when the Space key is
      mapped and remapping is disabled when the rhs starts with the lhs. But
      you use ":inoremap", this means the normal meaning of the Space key is
      disabled, it no longer triggers abbreviation expansion. If you would
      have used ":imap" then patch 6.3.023 fixes the problem.

      --
      Creating the world with Emacs: M-x let-there-be-light
      Creating the world with Vim: :make world

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
    • Antoine J. Mechelynck
      ... You re right. I am using gvim 6.3.028 on Win XP. With ... then, in Insert mode, starting a line as st followed by a space does not expand the abbreviation,
      Message 2 of 5 , Oct 4, 2004
      • 0 Attachment
        Moshe Kaminsky <kaminsky@...> wrote:
        > Hi,
        >
        > I don't know if this really deserves to be called a bug, but here it
        > is: If I map <Space> in insert mode, abbreviations are not expanded
        > when I press <Space>. For example
        >
        > > inoremap <Space> <Space>
        > > iab st such that
        >
        > The st will not expand after the space.
        >
        > I came across this while editing a latex file with the latex suite,
        > which indeed maps <Space>, but abbreviations did work for me with
        > latex a few months ago, so I believe it is caused by a change
        > introduced during this period.
        >
        > I'm using version 6.3.25 on linux.
        >
        > Thanks,
        > Moshe
        >
        > --
        > I love deadlines. I like the whooshing sound they make as they fly by.
        > -- Douglas Adams
        >
        > Moshe Kaminsky <kaminsky@...>
        > Home: 08-9456841

        You're right. I am using gvim 6.3.028 on Win XP. With

        :inoremap <Space> <Space><Left><Right>
        :iab st such that

        then, in Insert mode, starting a line as st followed by a space does not
        expand the abbreviation, but pressing Ctrl-] or <Esc> immediately after the
        abbreviation expands it. Feels to me lika a bug, but could it be a feature?
        (And if a feature, how does it work?)

        Best regards,
        Tony.
      • Bram Moolenaar
        ... It s not clear if disabling remapping explicitly also means that ... Since the RHS of the mapping starts with the LHS, remapping is automatically disabled.
        Message 3 of 5 , Oct 4, 2004
        • 0 Attachment
          Antoine Mechelynck wrote:

          > You're right. I am using gvim 6.3.028 on Win XP. With
          >
          > :inoremap <Space> <Space><Left><Right>
          > :iab st such that
          >
          > then, in Insert mode, starting a line as st followed by a space does not
          > expand the abbreviation, but pressing Ctrl-] or <Esc> immediately after the
          > abbreviation expands it. Feels to me lika a bug, but could it be a feature?
          > (And if a feature, how does it work?)

          It's not clear if disabling remapping explicitly also means that
          abbreviations should not be triggered. And you can work around it:

          :imap <Space> <Space><Left><Right>
          :iab st such that

          Since the RHS of the mapping starts with the LHS, remapping is
          automatically disabled. Patch 6.3.023 takes care that abbreviations
          still work in this situation.

          --
          hundred-and-one symptoms of being an internet addict:
          62. If your doorbell rings, you think that new mail has arrived. And then
          you're disappointed that it's only someone at the door.

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
          \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
        Your message has been successfully submitted and would be delivered to recipients shortly.