Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 994 Bytes

escaping-terminal-mode-in-an-nvim-terminal.md

File metadata and controls

27 lines (20 loc) · 994 Bytes

Escaping Terminal-Mode In An Nvim Terminal

A recent TIL by Chris Erin showed how to split open a terminal in a Neovim session -- :sp term://zsh.

The terminal is emulated into a Vim buffer which means that you can treat it sort of like any other Vim buffer. You start in Normal mode. Once you use any mapping that would transition you into Insert mode, you'll instead find yourself in Terminal mode. Terminal mode works just like any zsh session (give ls a try).

Try hitting <Esc> though and you'll see that you stay in Terminal mode instead of being transitioned back to Normal mode.

So how do you get back to Normal mode?

Hit <Ctrl-\><Ctrl-n>.

This is a pretty awkward key mapping though, so follow the Nvim Terminal docs and bring back the Escape key.

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