vscode-neovim: dot-repeat problems

I tried the version posted in this thread. It works in some cases (changing a word, appending to end of line), but not in others. Repeating the edit of oword acts like a paste of a new line and the word wherever your cursor is. Repeating the edit of inew word would sometimes work and sometimes only insert the last part of it. I think it was the space and the second word, but I couldn’t get it consistent. Repeating the edit of A (2) replaces the last character in the line with ‘)’. I believe this has to do with vs code auto-completing the close parenthesis.

_Originally posted by @ngharrison in https://github.com/asvetliakov/vscode-neovim/pull/173#issuecomment-592776169_

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 31
  • Comments: 23 (6 by maintainers)

Most upvoted comments

Sorry for the silence guys, was sorting out life problems. Will be back working on it soon

Took some time, but latest master works very well with . . There are few differences with vim . repeat explained in readme section. Going to release 0.0.52 tomorrow or at Monday. Sorry for long waiting guys!

I also see weird issues around dot repeats. I issue the following series of commands:

  • <kbd>i</kbd>
  • Type foo
  • Press <kbd>esc</kbd>
  • Press <kbd>.</kbd>

I expected it would repeat the foo insertion, but it actually moves my cursor one character left. Doesn’t seem linked to which file type, same in typescript or text files…

Well that explains it, it works if you build the current source code.

So until we get a new version, you can just install it from source:

yarn global add vsce
git clone https://github.com/asvetliakov/vscode-neovim.git
cd vscode-neovim
yarn install
vsce package

That will generate a vscode-neovim-0.0.50.vsix file.

Now in VSCode go to extensions, click the ellipsis at the top, and click install from vsix.

@asvetliakov don’t stress yourself out over this ❤️

Sorry for the silence guys, was sorting out life problems. Will be back working on it soon

Sorry, i didn’t knew you were from Spain. Please take care of your family and health.

@azizghuloum The extension was born when i got mad once again by using VSCodeVim. So no, no real insert mode unless vscode devs will have fixed their extension host (and they’re not willing to do that unfortunately). The lag problem is a thing that not happens for every person or every situation - it mainly depends what extensions are you using and how large and type-intensive your project.

Let me explain why it happens: once you handle type event you must send default:type event to character appear as we’re doing it here. Normally it’s not the problem, but new characters triggers onDocumentChanged event which is being handled by other extensions, including default ones, like language server clients. And they could block extension host, e.g:

  1. you open new ts file and type A
  2. the press is being handled by type handler and sent back to vscode with default:type event
  3. vscode handles event, display A and triggers document changed event
  4. typescript extension receives document changed event and tries to provide you auto-import suggestions/autocompletion list
  5. depending on your project it may take over 1 second - during this time, the extension host is blocked by TS extension (which is deserializing the results from the server, building the completion list, etc…) and blocking the other extensions
  6. you type B (this usually comes fast after A) - and nothing happens because the extension is waiting.

Back to the speed issue, in my broken fork which I’ve been using for 12 hours a day for 3 days now, I personally have not noticed any lag issues beyond normal. Maybe I’m not using it like you do, but I do edit some 3000 line typescript files, and I usually have more than 10 files open, and yeah, it’s not vim speed, but it’s the normal speed you’d expect being in vscode.

As for your project, try to install @types/aws-sdk , include it somewhere in your project and see what happens.

Can you point me to which part of the extension handles that? I know it’s not a type; it’s something else but I don’t know what it is.

This should be handled in document changed event. Need to send changes to neovim from here. It’s not easy task though.

The same happens to me. Changing a word with cw works, then using dot-repeat acts as dw (it deletes the word and does not insert new text).

Not working for me either. dot operator is one of the key reason to use vim. Please fix it ASAP.

Not working for me either 😐

@chmac The issue is for unreleased version from #173 . In the latest released dot repeat doesn’t work at all.

Maybe a stupid question but how come this is a new issue? Did “dot-repeat” work properly before? Did it stop working because of changes in the vscode?

@azizghuloum The problem with handling the insert mode in neovim itself - is the long and sad story about performance and “type” vscode event. Once it’s listening type events in insert mode it starts to lag

I’m facing this problem as well. Just let me know if any help is needed.

I also have issues with this that keeps me from using the plugin since I use the dot operator with change operator so frequently.

I’d be more than happy to work on this bug if I can be pointed in the right direction or if someone would like to pair remotely on it.