Wednesday, March 14, 2018

Re: map ecape

On Thu, Mar 15, 2018 at 12:13 AM, sergio <sergio@outerface.net> wrote:
>
> if I put
>
> nmap <ESC> :cq
>
> in my vimrc, I just got vim runned with
>
> :cq[2;2R
>
> in the command like
>
>
> if I put
>
> nmap <ESC> :cq<CR>
>
> in my vimrc, vim exits after start
>
>
> How to map escape key?
>
>
>
> --
> sergio

AFAIK, you can't. It even surprises me that you got the results above.
The Escape key is too important, both to interrupt a partially typed
command if you change your mind, and as the first byte in many
multibyte keycodes to and from the terminal _and_ the GUI (see all the
sequences starting with ^[ (colored blue if you haven't set a
colorscheme) in the output of ":help termcap"), it should be left well
enough alone.

If you want to map something near top left of your keyboard, use
either <S-F1> (which should be safe unless you already mapped it to
something else), or whatever your keyboard sends when you hit the key
just left of the digit-1 key (on my keyboard it is an "exponent 2"
i.e. ², a keystroke not used by Vim). Or if you don't require that it
be near top left, you can of course map anything not already in use —
maybe <F12> at the opposite end of the top row.

Best regards,
Tony.

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