0

Here's the minimal ~/.vimrc:

if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  au VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')

Plug 'Valloric/YouCompleteMe'
Plug 'andymass/vim-matchup'
call plug#end()

syntax enable

let g:ycm_complete_in_comments = 1

That's the smallest I could get. The behavior is that often while I'm typing inside an HTML comment, all the text that I've written since the last i gets deleted without leaving insert mode.

Unfortunately I've not understood the sequence of keys (actually just a-z and space) in insert mode that triggers it (if there is one!).

The following screencast shows the strange event. I mash the letters and space, but usually it happens while I'm typing something ordinary in a comment. And I'm not a very fast touch-typist.

asciicast

As you can see, I've also recorded they keys I pressed, with the -w option which I've learned of recently. However, it contains control characters, so I'm not sure how I can show it to you. gist.github.com turns those characters in red dots, and stackexchange turns them in little squares as you can see below. Well, there's at least a missing ^M/Enter at the end, though...

13jf!wijkjadslk fajlskfadlk sjfa sjfl ksdj flkasdjflkasjf aksj flkasj flkasfdjlkajflkdsjflaksdj flj sadlfkdsjlk fjasdlkfj asdlkfjalskfj laks jdf asj flk sdfjlaslkf jlsflks jfsa lk dsjf alkkjfdslk f lasdjfjlkasd jklfjal ksd jfalsdkf jkasj flkasj dlkfjklasdjflksjflsj flsd jfla sdlkf jals jdf lasj flasfkd jalksjflkasj flkasd fjalsdfkjaslkf aslj flsadj lkfjk asdfj lajs lf jas ldf asjlkfdlkj as jfaljf jsdlfla fsdlkf asjflsd kfjdfljk jlk jfa lsdj fljkjf lka jsdlkfa lskf jsda jflajfsdlkf jlkjfkjl fjalkfj l kjfaskl jfalkj jl  klkj j kl jlj l j l jkjkljlkjkljl kjlj lkj lk j lk jlklk jfljkfds jkf alsdf jldf jls l ajldsjl ajlf a jlfksd jfaslkd jlf jasd jfaljksd jfajl sdf jla jsdfjlfajsl€ýahhuijjjk sdfjlasdfj las jfasdklf aljkf jlks fljkas jkfa sjdlkf jklas jlfalj sfj ldsa f jasldi HERE IT IS THE COMMENT DELETED!!!u:q

Here's the version I obtain by selecting with the mouse and then pasting:

13jf!wijkjadslk fajlskfadlk sjfa sjfl ksdj flkasdjflkasjf aksj flkasj flkasfdjlkajflkdsjflaksdj flj sadlfkdsjlk fjasdlkfj asdlkfjalskfj laks jdf asj flk sdfjlaslkf jlsflks jfsa lk dsjf alkkjfdslk f lasdjfjlkasd jklfjal ksd jfalsdkf jkasj flkasj dlkfjklasdjflksjflsj flsd jfla sdlkf jals jdf lasj flasfkd jalksjflkasj flkasd fjalsdfkjaslkf aslj flsadj lkfjk asdfj lajs lf jas ldf asjlkfdlkj as jfaljf jsdlfla fsdlkf asjflsd kfjdfljk jlk jfa lsdj fljkjf lka jsdlkfa lskf jsda jflajfsdlkf jlkjfkjl fjalkfj l kjfaskl jfalkj jl  klkj j kl jlj l j l jkjkljlkjkljl kjlj lkj lk j lk jlklk jfljkfds jkf alsdf jldf jls l ajldsjl ajlf a jlfksd jfaslkd jlf jasd jfaljksd jfajl sdf jla jsdfjlfajsl^[^[<80>ýahhuijjjk sdfjlasdfj las jfasdklf aljkf jlks fljkas jkfa sjdlkf jklas jlfalj sfj ldsa f jasldi HERE IT IS THE COMMENT DELETED!!!^[^[u:q^M
8
  • I assume you couldn't repro that without one or both of the mentioned plugins? It's certainly very odd. Could be a result of an autocommand or insert-mode map?
    – D. Ben Knoble
    Oct 4, 2021 at 21:52
  • @D.BenKnoble, I haven't been able, yeah. Well, yeah, I suspect that could be, but I'm not sure how to figure out. I'll see again what the mappings are with this minimal vimrc.
    – Enlico
    Oct 6, 2021 at 6:19
  • @D.BenKnoble, output of :au and output of :map. Do you see anything?
    – Enlico
    Oct 6, 2021 at 7:35
  • Blocks around lines 3440, 3557, 3604 look a little suspicious
    – D. Ben Knoble
    Oct 6, 2021 at 11:36
  • Also you want to try :imap
    – D. Ben Knoble
    Oct 6, 2021 at 11:37

0

Your Answer

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

Browse other questions tagged or ask your own question.