Switching Vim Modes (insert, visual, etc) will hang VsCode
Describe the bug
In the most recent version of VsCode, switching modes will result in a hang.
This happens regardless of the mode switch, visual or insert or back to normal mode.
Setting "vim.statusBarColorControl": false, will alleviate the issue.
To Reproduce
- Have
"vim.statusBarColorControl": true,insettings.json - Switch to a different vim mode (e.g.: press
iin normal mode)
Expected behaviour No editor hang
Environment (please complete the following information):
- Issue Type:
Bug - Extension Name:
vim - Extension Version:
1.8.1 - OS Version:
Darwin x64 18.2.0(MacOS 10.14.3) - VSCode version:
1.36.0
This is related to #3825
Getting this as well:
- Extension Version:
1.8.1 - OS Version:
macOS Mojave 10.14.5 (18F203) - VSCode version:
1.36.0
Confirmed setting "vim.statusBarColorControl": false alleviates issue.
Yeah, it is quite heavy to have the Vim plugin edit the settings.json file and make VS Code re-fresh settings every time you switch modes.
Is there not a better way? Why doesn't the plugin instead trigger styling for a CSS class that targets the status bar, instead of modifying settings.json?
Getting this with Windows 10 as well.
Extension Version: 1.8.1
OS Version: Windows 10 Enterprise 1903 (Build 18362.175)
VSCode version: 1.36.0
Can also confirm that setting "vim.statusBarColorControl" to false removes the lag.
There is a disclaimer on our readme for this feature. Please see the linked issue for more background information: https://github.com/VSCodeVim/Vim#vim-airline
Tracking down what was causing this slowdown was rough. I turned this on a long time ago and never had issues until recently. Thanks for reporting!
@jpoon Thank you for pointing that out, however I already knew this feature came with a performance hit.
I have been using this feature for roughly 6-7 months now. As soon as VsCode updated to 1.36.0 it has made the editor become practically unusable. I'm talking a full 2 second hang after every mode switch vs maybe an extra millisecond from before.
The difference is night and day.
I encountered this when going to insert mode and typing a period. It was not set in my json file to anything.
Extension Version: 1.8.2 OS Version: OSX Mojave 10.14.6 VSCode version: 1.36.1
Confirmed manually setting "vim.statusBarColorControl": false alleviates issue.
----- UPDATED ----
Turns out this didn't fix the issue. It fixed the issue if I type a period, but it now hangs when I type a quote.
----- UPDATE -----
disabling the extension...
IntelliSense for CSS, SCSS class names in HTML, Slim and SCSS
...seems to have resolved the issue.
Guys, guess we have to ask the VSCode team for a proper API to change status bar instead of the current hack? I'm currently experiencing huge lag about 2~3 sec when switching mode or search which insane.
Just to add to the pressure, Vim plugin for Visual Studio Code has become unacceptable in the last months. I type fast, and I constantly get scrambled letters because Vim creates huge latency in responding to commands.
Looks like I was blaming it on Vim plugin when actually the "Auto Import" plugin was slowing down my whole Visual Studio Code. Sorry, it wasn't intentional. After uninstalling Auto Import, I still have auto suggestions, Eslint, and Vim Plugin, but no more abnormal slowdown.
For anyone who wants the fancy colors without the performance hit here is a custom styling with the Custom UI Style plugin (https://marketplace.visualstudio.com/items?itemName=subframe7536.custom-ui-style).
Put this into your settings.json:
"vim.statusBarColorControl": false,
"custom-ui-style.stylesheet": {
"[id='workbench.parts.statusbar']:has([id='vscodevim.vim.primary'].statusbar-item[aria-label='-- NORMAL --'])": {
"background-color": "#005f5f !important",
"color": "#ffffff !important"
},
"[id='workbench.parts.statusbar']:has([id='vscodevim.vim.primary'].statusbar-item[aria-label='-- INSERT --'])": {
"background-color": "#5f0000 !important",
"color": "#ffffff !important"
},
"[id='workbench.parts.statusbar']:has([id='vscodevim.vim.primary'].statusbar-item[aria-label='-- VISUAL --'])": {
"background-color": "#5f00af !important",
"color": "#ffffff !important"
},
"[id='workbench.parts.statusbar']:has([id='vscodevim.vim.primary'].statusbar-item[aria-label='-- VISUAL LINE --'])": {
"background-color": "#005f87 !important",
"color": "#ffffff !important"
},
"[id='workbench.parts.statusbar']:has([id='vscodevim.vim.primary'].statusbar-item[aria-label^=':'])": {
"background-color": "#007acc !important",
"color": "#ffffff !important"
},
"[id='workbench.parts.statusbar']:has([id='vscodevim.vim.primary'].statusbar-item[aria-label^='/'])": {
"background-color": "#007acc !important",
"color": "#ffffff !important"
},
"[id='workbench.parts.statusbar']:has([id='vscodevim.vim.primary'].statusbar-item[aria-label^='match '])": {
"background-color": "#007acc !important",
"color": "#ffffff !important"
},
},
Or if you dont want the entire statusbar colored, but just the mode indicator:
"vim.statusBarColorControl": false,
"[id='vscodevim.vim.primary']": {
"transition": "background-color 0.1s ease-in-out" // remove this if you dont want smooth effect
},
"[id='vscodevim.vim.primary'].statusbar-item[aria-label='-- NORMAL --']": {
"background-color": "#005f5f !important",
"color": "#ffffff !important"
},
"[id='vscodevim.vim.primary'].statusbar-item[aria-label='-- INSERT --']": {
"background-color": "#5f0000 !important",
"color": "#ffffff !important"
},
"[id='vscodevim.vim.primary'].statusbar-item[aria-label='-- VISUAL --']": {
"background-color": "#5f00af !important",
"color": "#ffffff !important"
},
"[id='vscodevim.vim.primary'].statusbar-item[aria-label='-- VISUAL LINE --']": {
"background-color": "#005f87 !important",
"color": "#ffffff !important"
},
"[id='vscodevim.vim.primary'].statusbar-item[aria-label^=':']": {
"background-color": "#007acc !important",
"color": "#ffffff !important"
},
"[id='vscodevim.vim.primary'].statusbar-item[aria-label^='/']": {
"background-color": "#007acc !important",
"color": "#ffffff !important"
},
"[id='vscodevim.vim.primary'].statusbar-item[aria-label^='match ']": {
"background-color": "#007acc !important",
"color": "#ffffff !important"
},
"[id='vscodevim.vim.primary'].statusbar-item[aria-label$=' written']": {
// "background-color": "#000000 !important",
// "color": "#ffffff !important"
},
"[id='vscodevim.vim.primary'].statusbar-item>a:hover:not(.disabled)": {
"color": "#ffffffbb !important"
}