Vim: Does not work in VSCode 1.41.1

Created on 25 Dec 2019  路  8Comments  路  Source: VSCodeVim/Vim

Extension does not work correctly in VSCode 1.41.1. It displays --NORMAL-- mode in the status bar at the bottom, the cursor looks right (like it should be in vim) mode. However, any key pressed work as if vim mode is disabled (i.e. while in --NORMAL-- mode pressing i types "i" symbol at the current cursor position, pressing h,j,k,l types "hjkl" symbols instead of moving the cursor).

Additionally issuing "Vim: Toggle Vim Mode" command produces command 'toggleVim' not found error popup.

Version: 1.41.1
Commit: 26076a4de974ead31f97692a0d32f90d735645c0
Date: 2019-12-18T15:04:31.999Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Linux x64 5.3.16-300.fc31.x86_64

I tried the following extension version: 1.12.3, 1.12.2, 1.11.3: same error.

short_error_demo_video.zip

Most helpful comment

@J-Fields I guess I have found the issue. it is some incompatibility with ra-lsp extension (rust-analyzer).

  1. If I disable ra-lsp extension VSCodeVim works fine.
  2. If I reenable ra-lsp extension and press reload button, I get the following error popup:
Enhanced typing feature is disabled because of incompatibility with VIM extension, consider turning off rust-analyzer.enableEnhancedTyping: https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/README.md#settings

Both ra-lsp and VSCodeVim work fine until restart of vs code.

  1. If I restart vscode, I no longer see this error popup from ra-lsp, and VSCodeVim is broken.
  2. If I disable rust-analyzer.enableEnhancedTyping in settings and restart vscode then VSCodeVim works fine.

So, it must me some incompatibility with ra-lsp and (possible) the order of extension initialization the causes the issue. My theory is that if ra-lsp is initialized after VSCodeVim (this is what happens when I enable it manually) ra-lsp detects the problems, displays the warning popup and disables rust-analyzer.enableEnhancedTyping option. Otherwise, if ra-lsp is initialized before VSCodeVim turn on the enhancedTyping (not sure what this is), and then when VSCodeVim initializes in simply silently breaks.

Hope that helps.

Thanks for your support.

All 8 comments

Try uninstalling and making sure that the extension directory is gone, then re-install.

This is the first thing I tried, no luck :( Is there anything else I should look at? Like some log file?

Same issue for me on Windows. I already reinstalled a couple of times sometimes.

@cryo28 what finally worked for me is:

  1. close all files so that there are no remaining tabs
  2. uninstall the vim extension
  3. check and if still there remove the vim extension folder from .vscode/extensions
  4. restart visual studio code
  5. install vim extension
  6. reopen files

It sounds strange, but for me the important step was to close all files. If I only reinstall the extension
and continue to work in files that were kept open during the whole process the vim extension did not
seem to work.

@cryo28 Do the above steps solve this issue for you?

@J-Fields I guess I have found the issue. it is some incompatibility with ra-lsp extension (rust-analyzer).

  1. If I disable ra-lsp extension VSCodeVim works fine.
  2. If I reenable ra-lsp extension and press reload button, I get the following error popup:
Enhanced typing feature is disabled because of incompatibility with VIM extension, consider turning off rust-analyzer.enableEnhancedTyping: https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/README.md#settings

Both ra-lsp and VSCodeVim work fine until restart of vs code.

  1. If I restart vscode, I no longer see this error popup from ra-lsp, and VSCodeVim is broken.
  2. If I disable rust-analyzer.enableEnhancedTyping in settings and restart vscode then VSCodeVim works fine.

So, it must me some incompatibility with ra-lsp and (possible) the order of extension initialization the causes the issue. My theory is that if ra-lsp is initialized after VSCodeVim (this is what happens when I enable it manually) ra-lsp detects the problems, displays the warning popup and disables rust-analyzer.enableEnhancedTyping option. Otherwise, if ra-lsp is initialized before VSCodeVim turn on the enhancedTyping (not sure what this is), and then when VSCodeVim initializes in simply silently breaks.

Hope that helps.

Thanks for your support.

Hmm, interesting. According to their docs:

by default, rust-analyzer intercepts Enter key to make it easier to continue comments. Note that it may conflict with VIM emulation plugin

So you could just disable that setting, or maybe hand <Enter> back to VSCode with handleKeys? That probably wouldn't lead to the best results, though. Either way, not much we can do about this, so I'm closing the issue.

@cryo28 are you still using VSCodeVim and rust-analyzer?
It seems there's no more enableEnhancedTyping option, but there's still this bug.

edit:
I find out you can use Shift+Enter to send Enter to VSCodeVim.
It's not so comfortamble, but at least usable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

triztian picture triztian  路  3Comments

ACollectionOfAtoms picture ACollectionOfAtoms  路  3Comments

jaredly picture jaredly  路  3Comments

stefanoio picture stefanoio  路  3Comments

elithrar picture elithrar  路  3Comments