Skip to content


Subversion checkout URL

You can clone with
Download ZIP


[ESC] doesn't leave insert mode #48

jonashaag opened this Issue · 2 comments

2 participants


To reproduce: Type {<CR><ESC>. Should now be in normal mode but have to press ESC again to leave insert mode.


Thank you for reporting. I'll investigate it later.


Interesting. The problem is appeared since I fixed an indentation problem about expanding {} block, etc.

According to the :help document about <C-o>:

The CTRL-O command takes you to Normal mode. If you then use a command enter Insert mode again it doesn't nest. Thus when typing a<C-O>a and then <Esc> takes you back to Normal mode, you do not need to type <Esc> twice.

The rules use <C-o>S to reindent blank lines. Since S is a command to enter Insert mode, a<C-o>S<Esc> should leave from Insert mode without extra <Esc>. But Vim doesn't behave so. It acts as if Insert mode is nested.

Furthermore, if a<C-o>S<Esc> is interactively typed by user, it leaves from Insert mode without extra <Esc>. But if a<C-o>S<Esc> is typed via :normal or :map, it requires extra <Esc> to leave Insert mode.

So I suspect that the problem is caused by this problematic behavior of Vim. I'll try to use other methods for proper indentation.

@kana kana closed this in 2de9334
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.