TL;DR: kitty uses a custom terminfo xterm-kitty. Vim doesn’t like it. If you’re in a pinch, commit a crime, and hopefully it works fine. If you’re not, switch to another terminal for vim, or switch to neovim, or attempt to teach vim to speak kitty.


If you use Vim in kitty, local machine or going through SSH, and (at least) one of these is happening:

  1. Paste Ctrl+Shift+V from system clipboard is egregiously slow. Like two lines per second slow1.
  2. Paste is glitchy. All the whitespace get eaten, nowhere to be seen. Lines get jumbled together, parts of the clipboard overwrite another, etc2.
  3. kitty tells you your clipboard contains terminal escape sequences. Except it absolutely does not. Pasting elsewhere, still in kitty, like into bash or nvim works completely fine2.

then congratulations, you have just discovered that Vim isn’t very compatible with kitty as a terminal emulator. Instead of trying to poorly summarize why, you can instead read the problem being extensively discussed con fuoco in the Vim issue tracker.

This problem is actually documented. On the Vim side, it’s in the help, without any mention of how to fix it.

On the kitty side, the FAQ mentions it, and also supplies some stuff to put in your .vimrc to make Vim happy. I have not personally tried any of these, and don’t understand a single thing about what they’re doing. Just for your reference.

I just want it work. Right now.

Try TERM=xterm-256color vim /my/file.txt.

It seems like by setting TERM to xterm-256color, Vim will understand at least the paste part mostly fine. I don’t know if bracketed paste is happening. This is highly discouraged per kitty’s documentation and opinion. Don’t use it long term, or you’ll find other inexplicable weirdness (which I had, but it’s all a blurry mess, so I can’t recite to you the war story, alas).

Other solutions

As far as I know, all other terminals pretend to be xterm well enough that Vim plays happily long. So you use them instead. I will keep a copy of Konsole on hand for situations where I have to use vim.

Neovim doesn’t seem to have any issue with kitty’s terminfo.

I prefer Neovim, and got in a habit to go out of my way to replace the default Vim on every system, in part because of this paste weirdness. Recently I got lazy and just went with the bundled Vim. This issue resurfaced, and I finally decided to research it in depth. I couldn’t find any internet echos regarding this issue apart from the ones I linked here. Maybe my searching skills have deteriorated. Maybe search engines are not as good anymore. In any case, hopefully writing this adds another data point.


  1. happened on a local ArchLinux machine ↩︎

  2. happened on SSH to a Debian Bookworm arm64 supplied by AWS EC2 ↩︎ ↩︎