Monday, July 16, 2012

Re: Key mapping behaves differently than same sequence of keys struck by hand

On 2012-07-16, Graham Lawrence wrote:
> As a keystroke sequence
> hEa"<Esc>Bi"<Esc>j
> seems to enquote the current word anywhere in the line.
> In particular, it does so if the cursor is in column 1 at the start of
> the first word.
>
> But as a key mapping, e.g.
> :map <F5> hEa"<Esc>Bi"<Esc>j
> it fails if the cursor is in column 1
>
> Why the difference?

The answer is buried rather deep in the documentation, in the third
paragraph below

:help map_return

Note that when an error is encountered (that causes an error
message or beep) the rest of the mapping is not executed. This
is Vi-compatible.

Regards,
Gary

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

No comments: