Open pingshunhuangalex opened 1 year ago
@pingshunhuangalex Interesting problem.
Have you tried this instead?
https://marketplace.visualstudio.com/items?itemName=asvetliakov.vscode-neovim
According to this article, it's much, much faster:
https://galenwong.github.io/blog/2021-03-22-vscode-neovim-vs-vscodevim/
And it uses native NeoVim, so there's no need to emulate Vim in JavaScript. It's all running natively with full support for all Vim commands.
Edit: The reason for VSCodeVim's slowness is because of how VSCode implements the JavaScript extension host. It's explained by a team member of VSCodeVim, who even recommended NeoVim as a solution:
https://github.com/VSCodeVim/Vim/issues/7546#issuecomment-1063674091
Someone even replied in that thread and said:
"I've just changed to vscode-neovim. Crazy fast."
Edit again: Here's someone who explains why the NeoVim extension is so much faster:
https://github.com/VSCodeVim/Vim/issues/7415#issuecomment-1019343700
In short, it seems to be because VSCodeVim has to register a type
event handler in VSCode, which is a very slow action due to a problem in VSCode. Seems related to calling the default type
handler from within a custom type
handler. It also seems like something related to autocompletion is slowing things down further.
The NeoVim plugin doesn't do that. It unregisters the type
handler while you write code, and sends all input to the NeoVim process instead. Then when you hit Escape to "return to VSCode" it re-registers the normal type
handler. So there's no lag/delay at all, because VSCode's keyboard handler is "disabled" while you are writing code in NeoVim.
Thanks for the suggestion @Bananaman
I've hesitated before between the 2 options and picked VSCodeVim back then, probably cuz it's maintained by Microsoft devs.
I've accumulated quite a bit of configs and became reluctant to migrate. Maybe it's time to change now. Thanks.
@pingshunhuangalex Yeah I know the problem about having a lot of configs, but I think it's better to have a usable editor than a super laggy one. Slow text is so bad for productivity and peace of mind. :/
I heard so many good reviews for NeoVim plugin and will switch to it.
VSCodeVim isn't maintained by Microsoft by the way? At least if I look at the contributors, I can't find any Microsoft devs:
https://github.com/VSCodeVim/Vim/graphs/contributors
It's mainly maintained by https://github.com/J-Fields who works at another company.
@pingshunhuangalex Oh, I was thinking about this again and just realized that there may have been a misunderstanding.
I wasn't saying "switch to NeoVim". :D
di{
" for "delete inside brackets" plugin and EasyMotion plugin etc. It uses VSCode for "insert mode" (text typing/autocompletion), and uses NeoVim for movements and editing movements (like jump/move, delete, copy, paste) every time you press Escape to leave "insert mode". So it's the best of both worlds. It even supports advanced Vim actions like visual mode's block copy and block paste.The last one is what I said we should switch to:
https://marketplace.visualstudio.com/items?itemName=asvetliakov.vscode-neovim
Thank you for the suggestion @Bananaman I didn't know such an extension existed. I'll give it a try. I came across this issue as the first thing I've noticed immediately after installing this plugin is the bizarre inconsistency even when navigating in normal mode.
Sometimes hitting the h key moves left, and sometimes it just decides not to do anything! Same thing when holding it: it either moves normally as expected, or just takes a moment then moves.
It's a shame. I really hope Microsoft works on a native Vim plugin, even if with a basic functionality. I think the Vim plugin in JetBrains IDEs is developed by JetBrains.
I have the same issue but in a 6000 line Markdown file. Typing gets really slow with the VIM extension enabled (I had found this through the VSCode Bisection of plugins).
Describe the bug I have a couple of 120k lines YAML files which I edit on a daily basis. With recent updates (in the past month or even a couple of weeks ago), VS Code has become so laggy that the letter needs to catch up when I type, and moving lines up and down becomes a nightmare. Keystrokes also get swallowed from time to time which makes things unusable.
Turning the extension off seems to fix the issue, but I really don't want to. Also please note that this was never a problem with VS Code Vim until recently. I can reproduce it on both Windows and Mac machines. Tried fresh reinstallation, but it doesn't do anything.
To Reproduce Steps to reproduce the behavior:
Expected behavior There shouldn't be any lag for basic operations and typing
Screenshots With VS Code Vim ON
With VS Code Vim OFF
Environment (please complete the following information):