I was noticing when I exit Insert Mode using ctrl+[, and very quickly press ctrl+w q wanting to quit, every time I will end with ctrl+w dropped for unknown reason and a pending q.

I tried starting vim with -w to record typed keys and found there are a few occurrences of this key sequences <80>ý` interleaved with my typed keys in the recorded file.

After some experiment I found if I comment out this line set updatetime=100 (which will set it back to default value 4000 ms i.e. 4s) in my vimrc, the ctrl+w will not be dropped. However there are still some similar <80>ýa sequences after my pressed ctrl+[ in the recorded file. And if I start vim as vim -u NONE, no such sequenced is recorded.

Further binary searching the source, the strange sequence seem to occur after defaults.vim has set set nocompatible. I read doc about 'compatible' and 'cpoptions' and didn't find anything relevant.

I can now reproduce this <80>ýa randomly after ctrl+[ in pure vim -u NONE without setting anything, both inside and outside of tmux, using XShell or Ubuntu's native terminal.

What is causing this? How can I stop Vim from producing this code sequences?

ps: I'm using XShell to ssh to a ubuntu server in my local VMware and running vim in tmux.
ý is decimal value 253 viewed with ga and 'fileencoding' is latin1

  • I guess the recorded keys with -w option is not exactly the keys having been pressed, or at least not the original code sequence vim has received. I recorded similar <80>kP for PageUp key while ctrl-v PageUp gives ^[[5~. May be this <80> stuff is vim's internal representation of keys. But I still don't know why in my case of ctrl-[ there is some extra code sequences being produced after ctrl-[.
    – Masquue
    Commented Jan 24, 2022 at 21:28


Your Answer

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

Browse other questions tagged or ask your own question.