Let Vim insert mode escape (esc) to normal mode even if suggestion dropdown open

Use case or problem

When typing a tag name or a file link in vim insert mode, obsidian will offer a dropdown of suggestions. If you want to go back to normal mode, you have to remember to hit escape twice if the suggestion dropdown is open while you are typing.

Proposed solution

Hitting escape while the suggestion dropdown is open only closes the suggestion box but I think it should put you in normal mode regardless of whether the suggestion dropdown is open. It’s annoying to think you’re in normal mode and try to do something only to realize you’re still in insert mode.

Current workaround (optional)

I attempted to use the vimrc plugin to imap <Esc> <Esc><Esc> but this doesn’t seem to work for me. Other workaround suggestions are welcome.

15 Likes

I’m also facing this issue. It really takes the flow out of vim.
It should be a simple fix. Hopefully, it’ll be addressed.

1 Like

Would really love to see this fixed as well.

1 Like

I have the same issue and it is pretty distractive.

1 Like

Related to: https://forum.obsidian.md/t/support-shift-esc-for-closing-autocompletion-popup/46176

1 Like

Would love to see a solution to this! The autocomplete popup completely destroys my flow whenever it shows up :slightly_frowning_face:

1 Like

Another +1 for getting this fixed!

Totally agreed here!

How do I disable the auto suggestions, this is very annoying? This also happens for the autosuggestions on words meaning that every word I am basically having to double click esc to exit insert mode.

This bug really bothers me, enough so that I’ve switched to editing my Obsidian markdown in neovim + obsidian.nvim, and only use Obsidian for minor edits and to view my vault.

I’d rather be able to use Obsidian for edits, so I’ve done some digging. It looks like the escape hardcode is here, in the CodeMirror autocomplete source. This specific keymap is read-only, but it appears the client can specify multiple keymaps, e.g. from ResourcesCo (I was unable to find other open source examples.)

I believe Obsidian should be able to:

  • provide hotkeys that override this keymap
  • create a custom keymap using these hotkeys that overrides the completionKeymap, and set it at a higher priority

I believe I can’t verify in Obsidian without either access to Obsidian source or decompiling the binary.

2 Likes

Thanks for digging. I hope the devs try further