dominikduda
dominikduda

Reputation: 335

NVIM - can't unmap escape key

I can unmap escape key from insert mode. When I call :iunmap <Esc> it says E31: No such mapping.

But when I call :imap <Esc> it says:

i <Esc> *@pumvisible() ? '<C-E>' : '<C-R>=<SNR>110_FlushBuffer()<CR><Esc>'

so it seems that in the end there is something on ESC.

Probably deoplete plugin messed something up.

I wanted to remap ESC to 2xESC because when there is deoplete (its same as youcompleteme) cloud ESC key closes the cloud, so I have to press ESC twice to exit insert mode.

Any way to fix it?

Upvotes: 2

Views: 988

Answers (1)

Justin M. Keyes
Justin M. Keyes

Reputation: 6964

But when I call :imap <Esc> it says:

i <Esc> *@pumvisible() ? '<C-E>' : '<C-R>=<SNR>110_FlushBuffer()<CR><Esc>'

The @ indicates a buffer-local mapping (created with :inoremap <buffer> <Esc> ...).

It turns out that :unmap also takes a <buffer> modifier. So in this case:

:unmap <buffer> <Esc>

Before doing that, you can see which plugin set the mapping:

:verbose map <Esc>

Upvotes: 1

Related Questions