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.
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.
Ok, I’ve decompiled the obsidian.asar file via these instructions, essentially using npx asar extract obsidian.asar ob.unpacked
I made the file readable via js-beautify (js-beautify lib/codemirror/vim.js)
The header says
// vim.js based on https://github.com/codemirror/CodeMirror/commit/793c9e65e09ec7fba3f4f5aaf366b3d36e1a709e (2021-12-04)
// Modified from https://github.com/nightwing/cm6-vim-mode-experiment/blob/master/src/vim.js 103a9b5 2021-12-03
NOTE:CodeMirror 6 exists, and is more mobile-friendly, more accessible, better designed, and much more actively maintained.
My above link/comment about the keymaps refers to CodeMirror 6.
I’m going to guess the best fix would be to upgrade to CodeMirror 6. Now the question is, is there something that is currently preventing that upgrade other than lack of time?