Wednesday, September 24, 2014

Re: How to force Vim to reconcider abbreviations?

On Wed, Sep 24, 2014 at 09:30:22AM +0300, Gevisz wrote:
> On Mon, 22 Sep 2014 10:37:20 -0700 (PDT)
> Ben Fritz <fritzophrenic@gmail.com> wrote:
> > On Monday, September 22, 2014 11:11:37 AM UTC-5, gevisz wrote:
> > > On Mon, 22 Sep 2014 19:05:59 +0300
> > > Gevisz <gevisz@gmail.com> wrote:
> > I was actually quite surprised to find that abbreviations don't work
> > if you wait 'updatetime' milliseconds between starting and ending the
> > abbreviation, triggering the CursorHoldI event. That could be due to
> > specific events firing, I don't really know, but it is not documented
> > anywhere I could find.
> >
> > This mapping seems to do what you want, as a workaround:
> >
> > inoremap <F4> <C-C>ciW<C-R>-<C-]>
> >
> > <C-C> is used to end insert mode without triggering events or
> > abbreviations, ciW then deletes the unexpanded abbreviation and
> > enters insert mode, <C-R>- inserts that deleted text, and then <C-]>
> > expands the abbreviation.

> Sorry but your suggestion does not work as <C-R> does not insert the
> deleted text back.

<C-R> isn't what inserts the text -- <C-R>- is

see

:h i_CTRL-R

if you want to understand it

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment