Closed ghost closed 5 years ago
What color vi uses as its background depends on vim's config, not kitty.
What color vi uses as its background depends on vim's config, not kitty.
This is not entirely true. Although Vim has some terminal-specific defaults, there is an OSC to query the background and foreground colors of the terminal, and Vim makes use of it.
src/termdefs.h
100: KS_RBG, // request background color
214:#define T_RBG (TERM_STR(KS_RBG)) // request background RGB
src/term.c
479: {(int)KS_RBG, "\033]11;?\007"},
The following is a small Python script that makes those queries and waits for a response. In GNOME Console, xterm, VS Code or Konsole, it will print the background and foreground, whereas in terminals not supporting it (like Kitty as of now) it will be stuck waiting.
https://gist.github.com/ntrrgc/fc47b416bff68ebc05883ec733c8a7b8
kitty most definitely supports it.
You're right, and I have checked the script again and it also runs in Kitty :/
Now I'm wondering what is making Vim stay in the wrong mode then...
There is a FAQ entry on vim in the kitty FAQ, follow it and you should be fine.
I see... Thanks for the pointers.
until I changed the color scheme in my kitty.conf, vim was starting with a dark background.
I changed the color scheme in kitty.conf, and it's still a dark color scheme, but vim now starts with a light background. I know I can do
set background=dark
to force vim to use the dark-backgrounded theme, but it's interesting to me why this isn't the default anymore, and how I can make it the default again.