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

Re: How to create a abbreviation that expand ".." to "->" correctly?

Expand Messages
  • Rainux
    Ah, I just forgot the insert mode mappings, this solved my question perfectly! Many thanks for your helps :) ... -- Best Regards Rainux
    Message 1 of 9 , Aug 1, 2007
    • 0 Attachment
      Ah, I just forgot the insert mode mappings, this solved my question perfectly!

      Many thanks for your helps :)

      On 8/1/07, Kurt Smith <kwmsmith@...> wrote:
      >
      > On 7/31/07, Rainux <rainux@...> wrote:
      > >
      > > I want when I typed "$this..var" in Vim, it can auto expand ".." to
      > > "->" so I got "$this->var", I've tried the following command in Vim,
      > > but it can work correctly.
      > >
      > > :iab .. ->
      >
      > With this abbreviation, VIM looks for a non-keyword character (usually
      > a \s character, but other non-keyword chars work, too) after the ".."
      > to trigger the abbreviation substitution. See :h 'iskeyword'. If you
      > type a k.w. character after the .. it doesn't kick in, hence
      > $this..var won't trigger, since the "v" is a keyword char.
      >
      > You could use
      >
      > :inoremap .. ->
      >
      > which will always work so long as you type the two dots within a
      > 'timeout' period. See :help 'timeout'. If you'd like two dots next
      > to each other, you'll need to type one dot, wait a 'timeout' period,
      > and type the other.
      >
      > Maybe there is a better way; anyone else?
      >
      > HTH,
      >
      > Kurt
      >
      > >
      >


      --
      Best Regards

      Rainux

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