# what does “\033]110\007\033]111\007” mean

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?

• The one point that @ChristianBrabandt didn't touch on in his answer was your query about the use of &. 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. – Rich Apr 25 at 13:19

t_ti and t_te are used by Vim (in the terminal) to switch between the different screens. The whole detail of this is described at :h xterm-screens and those are xterm terminal control sequences.
I am not sure, what your snippet is doing, it looks like it is requesting to set some foreground and background colors, using #rgb format. This is not supported by all terminals (and I think xterm does not yet completely support that according to this gist). So this might or not might work, depending on the terminal you are using. The full details of the terminal escape sequences can be read at Thomas Dickeys website: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html