Wednesday, March 16, 2016

Re: Mapping to

Hi Dmitri!

On Mi, 16 Mär 2016, Dmitri Vereshchagin wrote:

> According to the documentation these commands
>
> map <F1> <Esc>
> map! <F1> <Esc>
>
> should be sufficient to map <F1> to <Esc> in all major mapping modes.
> However in this case <F1> doesn't stop Select mode and acts like <CR>
> in Command-line mode.
>
> I found that desired effect could be achieved by using
>
> map <F1> <Esc>
> map! <F1> <Esc>
> cmap <F1> <C-C>
> smap <F1> <Esc>
>
> Why is that? Is there anything special about <F1> key?

For command mode, when a key is mapped to esc, it always works like
pressing enter. This is IIRC the vi-compatible way. This is done on
purpose and I don't know why (and it seems like nobody was interested in
a patch).

Best,
Christian
--
Gedanken sind nicht stets parat. Man schreibt auch, wenn man keine
hat.
-- Wilhelm Busch

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