On Fri, 21 Apr 2006 at 12:38pm, Yegappan Lakshmanan wrote:

> Hi Hari,
>
> On 4/21/06, Hari Krishna Dara <[EMAIL PROTECTED]> wrote:
> >
> > According to the doc, the '. mark is supposed to indicate the position
> > where the last change started, but the value always seems to be the
> > current column. I tried this in both vim 6.3 and 7.0e, and they both
> > behave the same. In Vim7, I tested the value in two ways, using
> > expression register and using an imap with <expr> option. E.g., here is
> > what I typed:
> >
> > <C-R>=col("'.")<CR>abc<C-R>=col("'.")def<C-R>=col("'.")
> >
> > which resulted in
> >
> > 1abc4def7
> >
> > I also tried this:
> >
> > inoremap <expr> <F12> col("'.")
> > <F12>abc<F12>def<F12>
> >
> > which again resulted in the same string. Is it working as expected?  If
> > this is expected, I wonder how useful it is going to be, when it always
> > equals the current column. I was expecting to see:
> >
> > 1abc1def1
> >
>
> I think this is behaving as documented under :help '.
>
> --------------------------------------------------------------------------
> The position is at or near where the change started.
> Sometimes a command is executed as several changes,
> then the position can be near the end of what the
> command changed.  For example when inserting a word,
> the position will be on the last character.
> --------------------------------------------------------------------------
>
> As noted by the last sentence, when you are inserting text,
> the '. mark is set to position of the last inserted character.
>
> - Yegappan

So, this gives a different value than col('.') only when the last
inserted value is a word of more than 1 characters (which I can imagine
can happen only through the expansion of an abbreviation or macro)? I
was looking for a mark that can give me the column position where the
current insert mode itself started. Is this possible? The doc is kind of
confusing, some examples will help.

-- 
Thanks,
Hari

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to