When using vim with coc installed, auto-complete is always opening and characters are being inserted into the window where the first auto-complete was displayed.

  • I have a directory with two files (main.ts and second.ts)
  • I open the first file in vim: vi main.ts
  • I do any editing which triggers auto-complete (e.g. enter insert mode type 'i', which prompts auto-complete option of if, among others)
  • I open the second.ts file in another window: :vsplit second.ts
  • In the new window (from now on the right window, and the window showing main.ts will be the left window), I do any editing which triggers auto-complete (e.g. enter insert mode and type 'h')
    • The autocomplete options appear in the left window
    • Any subsequent characters are also entered in the left window (e.g. if I type "hello", h is entered in the right window, and ello is entered in the left window.
  • Any characters incorrectly entered in the left window, are part of the buffer (e.g. if I save the left window with :w, ello will be included in the file written to disk), but are not part of the undo history for that buffer (e.g. if after typing "hello", I exit insert mode and U to undo, the characters ello remain, and the previous edit in that window is undone).

I'm just starting to seriously replace VSCode with vim, so I'm fairly new to the ecosystem and haven't had luck finding others with similar issues with Google searches. I'm not sure which environmental issues are the most important to isolate first for this kind of an issue.

The full list of plugins I have installed is below:

call plug#begin()
Plug 'junegunn/fzf.vim'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'rust-lang/rust.vim'
call plug#end()

The problem continues to happen when I comment out everything except coc.nvim, and goes away if I comment out coc.nvim

  • 2
    If you remove coc.nvim from the equation, do you have the same problem? If yes, then you should probably open an issue in Vim's issue tracker. If no, then you should use the plugin's official support channels, where you are far more likely to find a solution than here.
    – romainl
    Mar 21, 2023 at 6:08
  • 1
    This looks really odd :-| I would be happy to see a short screen cast. I'm using Vim and Coc on several windows (splits) in parallel and I don't experiment that behavior. Did you have it with a very short subset of plugins (e.g. only Coc)? Mar 21, 2023 at 9:22
  • @romainl That was helpful, thanks. When I comment out coc.nvim from my Plug section of my .vimrc, the problem indeed goes away. I'm new enough to vim that I thought a plugin was required to get autocomplete prompts, so it was helpful enough to just try without COC. Stock vim doesn't seem to have the problem, so I'll also go ask in COC specific forums also. Thanks Mar 21, 2023 at 18:49
  • @VivianDeSmedt I've uploaded a screen recording to S3 here: tmp-file-share-2b1a3b35a9683740c5d06b4921016ce2.s3.us-west-2.am… (191.1 KB). In the recording I: open main.ts, start typing ma, and then autocomplete main, then delete the line. I open a vsplit with second.ts, start typing hello, ESC to exit insert mode, then undo and redo several times, before qall! Mar 21, 2023 at 19:05
  • 1
    @VivianDeSmedt The full list of my plugins from my vimrc has been added to the question. It continues to occur even when I comment out fzf and rust and only leave coc.nvim in the Plug section. Mar 21, 2023 at 21:21

1 Answer 1


There was a similar issue reported in coc (#4396 Inserting text in a split window causes the cursor to jump to another split) that was resolved by upgrading vim to at least patch 961 (9.0.961).

I updated vim to the latest available patch (9.0.1424), and that resolved my issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.