[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim
Subject:    RE: Mappings again
From:       Gerald Lai <laige () eecs ! oregonstate ! edu>
Date:       2006-03-30 18:42:51
Message-ID: Pine.LNX.4.63.0603301035220.31291 () larsenbay ! eecs ! oregonstate ! edu
[Download RAW message or body]

On Thu, 30 Mar 2006, Halim, Salman wrote:
>> -----Original Message-----
>> From: Peter Slizik [mailto:peter.slizik@savba.sk]
>> Sent: Thursday, March 30, 2006 11:15 AM
>> To: vim@vim.org
>> Subject: Mappings again
>>
>>
>> Dear Salman and others,
>>
>>> I would recommend switching the imap to:
>>> :imap <f7> <c-o><f7>
>>>
>>> The <c-o> will take care of bringing you back to insert mode more
>>> accurately than the <esc> and i sequence, and I'm not crazy about
>>> duplicating behaviours, though you could just change it (if
>> you don't
>>>
>>> Salman.
>>
>> is there a *substantial* difference between "<Esc>[code]a"
>> and "<c-o>[code]"?
>> I mean, does the <Esc> version have some side effects or what?
>>
>> Thanks for the answer,
>>
>> -- Peter
>>
>> --
>> There's no trick to being a humorist when you have the whole
>> government working for you. --Will Rogers
>>
>
> The escape version won't work correctly if you're at the beginning or
> end of a line, depending on whether you used i or a, I believe.
>
> Salman.
>

In addition to Salman's comment, the escape version will also convert
REPLACE mode to INSERT mode.

If you're adamant about using the escape version, I'd suggest using "gi"
instead of "i". This will rid you of the incorrect cursor placement at
the beginning or end-of-line. As in,

   :inoremap <Fx> <Esc>[code]gi

See :help gi.

By the way, can "gi" be made to remember REPLACE mode too? Any opinions,
Bram/developers?
--
Gerald
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic