I can't figure out how to go back to Normal mode after entering Terminal in Insert mode...

Escape just doesn't seem to work.

Any idea?


You are supposed to press <C-\><C-n>.

See :help terminal-emulator for a mapping suggestion.

  • 1
    In Vim 8.2 it's :h Terminal-mode. – MikaelF Feb 20 '20 at 3:32
  • I guess it's not exactly NeoVim, but this also works for the Terminal mode added to vanilla VIM – polynomial_donut May 18 '20 at 20:26
  • or use <c-w><N> (uppercase "N" !!!) as mentioned below vi.stackexchange.com/a/27089/2239 by @Xuan. for me this is more vim-natural then <c-\> – eli Sep 7 '20 at 12:27
  • What kind of "shortcut" is this? It's not natural at all! To remap to Esc use :tnoremap <Esc> <C-\><C-n> – adelriosantiago Apr 27 at 17:25
  • @adelriosantiago Vim comes with very few "shortcuts". This is not one of them and no one is pretending it to be one but you. – romainl Apr 27 at 17:34

The answer by @romainl is correct but I wanted to add a bit more info for anyone that may have stumbled on this from google like I did.

Directly from the docs we get this note:

Terminal mode has its own namespace for mappings, which is accessed with the "t" prefix. It's possible to use terminal mappings to customize interaction with the terminal. For example, here's how to map to exit terminal mode:

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

With that knowledge you will most likely need to create some terminal mappings to stay inline with your current workflow (tab/window movement, etc.)

  • Hi, I set up that exact mapping, but I'm pressing <Esc> and nothing happens. Any idea why? – Kevin Burke Jun 2 '16 at 1:16
  • if you add it from Ex mode are the results the same? might be updating the wrong config file.. – Dan Bradbury Jun 2 '16 at 1:29
  • 2
    Thanks. This helped me add my preferred mapping of tnoremap kj <C-\><C-n> – Nick Merrill Oct 30 '16 at 17:57

Exit & close

tnoremap <Esc> <C-\><C-n>:q!<CR>

In Vim 8, this also works:

tnoremap <ESC> <C-w>:q!<CR>
  • 1
    You don't need the N in <c-w>N, you can simply press : after <c-w>. And if you really want to close Vim with all its open buffers and windows, than :qa! might be the better choice. But one would loose all changes in that case. – Christian Brabandt Sep 26 '18 at 14:33
  • 2
    Much better is tnoremap <Esc> <C-\><C-n>:bd!<CR>, which force closes the terminal buffer but not the entire Vim session. – Josh Friedlander Jul 27 '20 at 17:48

According to vim documentation, there are two ways:

  1. CTRL-W N (note it's uppercase N)
  2. CTRL-\ CTRL-n

Use CTRL-W N (or 'termwinkey' N) to switch to Terminal-Normal mode. Now the contents of the terminal window is under control of Vim, the job output is suspended. CTRL-\ CTRL-N does the same.


If you are using Tmux, you may have installed some "vim-like" bindings to move around in the window panes which among other things grab the "C-\" before Vim has a chance to use it. If so, remove these from your .tmux.conf and restart tmux:

bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind-key -T copy-mode-vi C-\ select-pane -l


You can just press Ctrl + D in terminal to close it. But if you don't want to close it, just want to switch windows you can do Ctrl-W w (if you have multiple panes you can specify to which you switch with the seccond letter (h,j,k,l), W just switches vim windows.

  • Ctrl + D is not an option as it exits the terminal. I just wanted to go back to Normal mode. On the contrary, your suggesting "changing window" is a nice option, since it is often the case I have another window pane. +1. – Stephane Rolland Feb 6 at 23:10

Well, I am surprised that no other commment mention it so maybe it's bad practice but I personnaly just typed exit and it worked.

  • 3
    Not bad practice, but you’ve misunderstood the Q i think. The idea is usually to keep the terminal running, but navigate it in normal mode for a brief moment. Your solution ends the process (and doesnt work for non-shell-like things), while the ctrl-\ ctrl-n allows me to navigate, yank, etc., and then press i and keep working in that terminal – D. Ben Knoble Jun 25 '20 at 12:29
  • Just to append to the answer, <Ctrl-D> feeds an end-of-file keycode, closing most shells, and by extension the terminal. Pressing two keys (with one hand) is quicker than 5 keys (with two hands). :) – mazunki Nov 6 '20 at 9:24

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.