On Sat, Feb 14, 2009 at 7:59 AM, Tony Mechelynck wrote:
>
> On 14/02/09 08:57, Matt Wozniski wrote:
>>> Sean wrote:
>>>>> You can add an undo step whenever you insert a Space this way:
>>>>>      :imap<Space>  <Space><C-G>u
>>>>>
>>>>> Notes:
>>>>> :imap (vs. :inoremap) is used to still be able to expand abbreviations.
>>>>> There is no endless loop, see
>>>>>      :h recursive_mapping
>>
>> I wouldn't have thought that would affect abbrs... good to know.
>
> It doesn't.

Yes it does.

$ gvim -u NONE -N -c "iabbr a b" -c $'imap <space> <space>\au'

Typing "a<space>" in insert mode puts a "b" in the buffer.

$ gvim -u NONE -N -c "iabbr a b" -c $'inoremap <space> <space>\au'

Typing "a<space>" in insert mode puts an "a" in the buffer; the imap
fired but not the iabbr.

> ":noremap" and friends prohibit remapping the _right_ hand
> side of the mapping they define. They have no influence whatsoever on
> whether or not the _left_ hand side of that same mapping will be
> expanded if found in the expansion of another mapping or abbreviation.

Right, but the abbreviation of the expansion is caused by the space
that is inserted on the RHS.  When remapping is disabled, that space
doesn't cause the abbr to be expanded.  It seems that <C-]> also
doesn't cause the abbr to be expanded...

~Matt

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to