On Feb 5, 4:05 am, ZyX <[email protected]> wrote:
> Reply to message «Re: ctrl-o with a mapping»,
> sent 23:56:30 05 February 2011, Saturday
> by AK:
>
> > Well, this is a normal mode mapping (nnoremap), by definition all of its
> > contents should run under normal mode or not at all.
>
> The fact that it is normal mode mapping means that {lhs} will be replaced by
> {rhs} if you type {lhs} in normal mode. It never meant that it should run 
> under
> normal mode, the fact that first command is run under normal mode is just a
> consequence of the fact that you press {lhs} in normal mode.
>

It seems strange to me that recorded macros behave differently from
normal mode mappings, especially if you interpret them as above. :help
@ even says "the register is executed like a mapping".

For example:

qa0:echo getfontname()<Enter>q
i<C-O>@a

This does not insert the :echo getfontname(), it does exactly as is
done in normal mode.

However,

:nnoremap <F9> 0:echo getfontname()<CR>
i<C-O><F9>

This inserts the :echo command in the text.

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

Reply via email to