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
andsecond.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, andello
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 andU
to undo, the charactersello
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
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. Thanksma
, and then autocompletemain
, then delete the line. I open a vsplit with second.ts, start typinghello
,ESC
to exit insert mode, then undo and redo several times, beforeqall!