I have remaped enter terminal normal-mode to <Esc> with: tnoremap <Esc> <C-\><C-n> and it does work.

But I am using zsh vi-mode, which also requires the use of <Esc> to enter normal mode in the current line.

Hence, with <Esc> binded to enter terminal-normal mode I couldn't use this feature of zsh vi-mode anymore.

So I tried to remap neovim enter terminal-normal mode to something else but nothing worked. Here are some examples for Shift+Escape and Ctrl+Escape:

tnoremap <S-Esc> <C-\><C-n>

tnoremap <C-Esc> <C-\><C-n>

I tried other random stuffs but same issue. I am doing something wrong?

  • 1
    Welcome to Vi and Vim! Even with the new modifyOtherKeys, I doubt you'll be able to map C-Esc or S-Esc. You'll probably have to pick another key-sequence.
    – D. Ben Knoble
    May 13 at 15:01
  • Thanks for the welcome message! Indeed, I didn't figure out anything else, your link probably explains why. For now I have remaped Esc to jk and it let me use zsh vi mode with Esc (making that possible wasn't the reason I remaped Esc to jk, but it provided a nice workaround for this problem).
    – flbk
    May 14 at 20:51

I've just hit this problem, too. Using <leader><ESC> seems to work, though:

tnoremap <leader><Esc> <C-\><c-n>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.