From 63eeab169fefb329c5d8a89c748e371128c7071a Mon Sep 17 00:00:00 2001 From: surtur Date: Tue, 26 Mar 2024 21:25:03 +0100 Subject: [PATCH] vimrc: add some obscure control codes for kitty's sake --- .vim/vimrc | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/.vim/vimrc b/.vim/vimrc index b550f66..e111b8c 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -1367,6 +1367,32 @@ set updatetime=250 " set updatetime=200 " set updatetime=100 +" https://sw.kovidgoyal.net/kitty/faq/#using-a-color-theme-with-a-background-color-does-not-work-well-in-vim +" work around vim's background colour erase: +" +" vim hardcodes background color erase even if the terminfo file does +" not contain bce (not to mention that libvte based terminals +" incorrectly contain bce in their terminfo files). This causes +" incorrect background rendering when using a color theme with a +" background color. +let &t_ut='' +" Bracketed paste +let &t_BE = "\e[?2004h" +let &t_BD = "\e[?2004l" +let &t_PS = "\e[200~" +let &t_PE = "\e[201~" +" Cursor control +let &t_RC = "\e[?12$p" +let &t_SH = "\e[%d q" +let &t_RS = "\eP$q q\e\\" +let &t_SI = "\e[5 q" +let &t_SR = "\e[3 q" +let &t_EI = "\e[1 q" +let &t_VS = "\e[?12l" +" Window title +let &t_ST = "\e[22;2t" +let &t_RT = "\e[23;2t" + if (has('termguicolors')) set termguicolors else @@ -1706,16 +1732,6 @@ nnoremap vr :source $MYVIMRCcall RefreshUI() let base16colorspace=256 -" https://sw.kovidgoyal.net/kitty/faq/#using-a-color-theme-with-a-background-color-does-not-work-well-in-vim -" work around vim's background colour erase: -" -" vim hardcodes background color erase even if the terminfo file does -" not contain bce (not to mention that libvte based terminals -" incorrectly contain bce in their terminfo files). This causes -" incorrect background rendering when using a color theme with a -" background color. -let &t_ut='' - " as per https://github.com/direnv/direnv/wiki/Vim if exists('$EXTRA_VIM') for path in split($EXTRA_VIM, ':')