IdeaVim: can't escape insert mode Follow
Answered
I can't escape insert mode in IdeaVim. normally this should require hitting the <ESC> key.
Troubleshooting steps taken:
1) look closely at keybindings. I've ensured that "Editor Actions" -> "Escape" is associated with the <ESC> key. Further, I've tried "Plugins" -> "ideavim" -> "Exit Insert Mode" being set to <ESC>. Neither let me escape insert mode.
2) Disable ideavim plugin, restart, reenable ideavim plugin, restart.
3) Uninstall ideavim plugin, restart, reinstall ideavim plugin, restart
4) hitting <esc> multiple times
IdeaVim version 0.49
PyCharm 2018.1
Please sign in to leave a comment.
Turns out I had disabled IdeaVim with a keystroke. I've fixed this, and disabled the keystroke. "Tools" -> "Vim Emulator" for the curious.
I'm having the same problem with IntelliJ Ultimate Edition. There is no "Vim Emulator" configuration preference. I've experienced this a year or two ago and my approach was to blow everything away and reinstall, unfortunately.
I've tried re-installing IdeaVim, but no luck. I'm going to try just reinstalling IntelliJ. I don't want to `rm` my preferences...
Took a look at the logs (~Library/Logs/IntelliJIdea2018.1/). Found this, which looks suspicious:
2018-07-13 14:42:42,582 [ 210539] ERROR - ij.components.ComponentManager - null
java.lang.NullPointerException
at com.maddyhome.idea.vim.EventFacade.getTypedAction(EventFacade.java:125)
at com.maddyhome.idea.vim.EventFacade.restoreTypedActionHandler(EventFacade.java:69)
at com.maddyhome.idea.vim.VimPlugin.disposeComponent(VimPlugin.java:183)
at com.intellij.openapi.components.impl.ComponentManagerImpl.disposeComponents(ComponentManagerImpl.java:135)
at com.intellij.openapi.application.impl.ApplicationImpl.dispose(ApplicationImpl.java:485)
at com.intellij.openapi.util.Disposer$1.execute(Disposer.java:48)
at com.intellij.openapi.util.Disposer$1.execute(Disposer.java:44)
at com.intellij.openapi.util.objectTree.ObjectNode$1.execute(ObjectNode.java:138)
at com.intellij.openapi.util.objectTree.ObjectNode$1.execute(ObjectNode.java:107)
at com.intellij.openapi.util.objectTree.ObjectTree.executeActionWithRecursiveGuard(ObjectTree.java:169)
at com.intellij.openapi.util.objectTree.ObjectNode.execute(ObjectNode.java:107)
at com.intellij.openapi.util.objectTree.ObjectTree.executeAll(ObjectTree.java:144)
at com.intellij.openapi.util.Disposer.dispose(Disposer.java:129)
at com.intellij.openapi.util.Disposer.dispose(Disposer.java:125)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$disposeSelf$7(ApplicationImpl.java:244)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1010)
at com.intellij.openapi.application.impl.ApplicationImpl.disposeSelf(ApplicationImpl.java:244)
at com.intellij.openapi.application.impl.ApplicationImpl.doExit(ApplicationImpl.java:772)
at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:748)
at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:737)
at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:714)
at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:709)
at com.intellij.ide.MacOSApplicationProvider$Worker.lambda$null$3(MacOSApplicationProvider.java:106)
at com.intellij.ide.MacOSApplicationProvider$Worker.lambda$submit$7(MacOSApplicationProvider.java:197)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
at com.intellij.openapi.application.TransactionGuardImpl.lambda$pollQueueLater$0(TransactionGuardImpl.java:74)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:447)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:431)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:415)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:786)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:727)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:395)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2018-07-13 14:42:42,583 [ 210540] ERROR - ij.components.ComponentManager - IntelliJ IDEA 2018.1.6 Build #IU-181.5540.7
2018-07-13 14:42:42,583 [ 210540] ERROR - ij.components.ComponentManager - JDK: 1.8.0_152-release
2018-07-13 14:42:42,584 [ 210541] ERROR - ij.components.ComponentManager - VM: OpenJDK 64-Bit Server VM
2018-07-13 14:42:42,584 [ 210541] ERROR - ij.components.ComponentManager - Vendor: JetBrains s.r.o
2018-07-13 14:42:42,584 [ 210541] ERROR - ij.components.ComponentManager - OS: Mac OS X
I removed all the settings in ~/Library/ etc according to this page:
https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs
Reinstalled IntelliJ and imported *all* of my settings and it still has the same problem. Going to try to uninstall, remove everything, and just import a subset of the settings.
After blowing everything away, reinstalling, and only installing IdeaVIM, I am able to oscillate between insert and normal mode.
I re-imported "Key maps", "Key maps (schemes)", and "VimSettings", which caused the issue to happen again.
I re-imported the settings one at a time. Importing "Key maps" and "Key maps (schemes)" is fine, but when importing "VimSettings", that is when it breaks.
I saved all my settings before importing them one at a time. After importing "VimSettings" from the non-broken state, it works again. I'm going to see if I can compare the two settings files to root cause what the issue is and see if it can be fixed manually in the future.
I think it is the same problem that @Jprice mentioned, but the switch to turn on/off emulation isn't available in IntelliJ. Comparing the vim_settings.xml files from the working and broken state, I noticed the following element at the beginning of the XML file (this is located at ~/Library/Preferences/IntelliJIdea2018.1/options/vim_settings.xml on mac):
<application>
<component name="VimSettings">
<state version="4" enabled="false" />
....
In the "Plugins" section of Preferences, turning off theIdeaVim plugin (not un-installing), restarting the IDE, and then turning on the plugin does nothing. I was running:
watch "head vim_settings.xml"
the entire time. I then manually edited the file, changing "false" to "true", which fixed the issue.
I don't know if this is a bug in IntelliJ or IdeaVim.
Thank you. This just popped up for me a week ago and I'm changing enabled to true in vim_settings.xml fixed it for me.
Having a look at the vim_settings.xml file and re-enabling the plugin manually did the trick for me as well. Don't know what disabled the plugin in the first place. Caused me lots of headaches though. Thank you so much for the hint!
Thank you so much! This totally fixed it when nothing else would.
Oh well done, Errors & Glitches, that was some excellent sleuthing!
There is a remaining problem, in that the issue always returns. Especially if — like me — you switch Vim emulation on and off. Whenever you exit your IDE while Vim emulation is off, enabled="false" gets written back to vim_settings.xml
And then the next time you start the IDE, the problem is back.
If you still have some issues using IdeaVim plugin, please report it to https://youtrack.jetbrains.com/issues/VIM
@sergey karpov
I've opened an issue for tracking:
https://youtrack.jetbrains.com/issue/IDEA-225193