2

I have remapped "enter terminal normal-mode" to <Esc> with: tnoremap <Esc> <C-\><C-n> and it works.

I also use zsh vi-mode, which requires <Esc> to enter normal mode at the prompt.

With <Esc> bound to "enter terminal-normal mode" I can’t use this feature of zsh vi-mode anymore.

So I tried to remap Neovim’s "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 stuff, but I had the same issue.

2
  • 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, 2021 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, 2021 at 20:51

1 Answer 1

0

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

tnoremap <leader><Esc> <C-\><c-n>
1
  • Not a new answer; just a matter of preference... I chose to use tnoremap <Esc><Esc> <C-\><c-n>. vi-mode in the shell still works as expected
    – Phil R
    Mar 3, 2023 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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