I found this snippet online which is apparently a way to make vim a little faster if your terminal background is the same as what vim's is meant to be (right?)
" General colors
if has('gui_running') || has('nvim')
hi Normal guifg=#a89984 guibg=#282828
else
" Set the terminal default background and foreground colors, thereby
" improving performance by not needing to set these colors on empty cells.
hi Normal guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE
let &t_ti = &t_ti . "\033]10;#a89984\007\033]11;#282828\007"
let &t_te = &t_te . "\033]110\007\033]111\007"
endif
What are t_ti
and t_te
?
I looked up :help t_te
and found out that these t_ti
and t_te
"put terminal in termcap mode", looking up :help termcap
didn't help me (I don't really understand what it is/means). Also looking up :help &
didn't help me understand why t_ti
etc. have had &
prepended.
I thought this kind of stuff \033]...
were escape codes so I also did :helpgrep escape code
but didn't find anything useful. Probably they're a part of the terminal/shell so not in vim's help, but then I don't know how to try to find out more about them.
Is someone able to explain what exactly the snippet is doing/how it does it?
&
. This allows you to set options using:let
instead of:set
, which is sometimes easier when the option's contents are complicated. See:help let-&
for details. Without the&
you'd just be setting Vimscript variables that happen to have the same names as the options, which would thus have no effect on Vim's behaviour.