map ecape

31 views
Skip to first unread message

sergio

unread,
Mar 14, 2018, 10:43:54 PM3/14/18
to vim...@googlegroups.com

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

Tony Mechelynck

unread,
Mar 15, 2018, 1:48:23 AM3/15/18
to vim...@googlegroups.com
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.

sergio

unread,
Mar 15, 2018, 5:17:45 PM3/15/18
to vim...@googlegroups.com
On 15/03/18 08:48, Tony Mechelynck wrote:

> maybe <F12> at the opposite end of the top row.

<F12> is Fullscreen everywhere!


--
sergio

Tony Mechelynck

unread,
Mar 15, 2018, 9:14:19 PM3/15/18
to vim...@googlegroups.com
Oh yeah? On Linux it is <F11> which toggles Fullscreen everywhere.
Well, that <F12> was only an example anyway.
>
>
> --
> sergio

Best regards,
Tony.

sergio

unread,
Mar 16, 2018, 5:57:38 PM3/16/18
to vim...@googlegroups.com
On 16/03/18 04:14, Tony Mechelynck wrote:

> Oh yeah? On Linux it is <F11> which toggles Fullscreen everywhere.

My mistake, F11 of course!


--
sergio
Reply all
Reply to author
Forward
0 new messages