aboutsummaryrefslogtreecommitdiff
path: root/vim/doc/detect_background.txt
blob: ed122aee8f8f85a6822d5a332a372c2486047871 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
*detect_background.txt*  Figure out 'background' with a bias towards "dark"

Author:  Tom Ryder <tom@sanctum.geek.nz>
License: Same terms as Vim itself (see |license|)

The detect_background#DetectBackground() function provided by this plugin
inspects the $COLORFGBG environment variable to determine whether the user is
using a terminal with a light background, and returns the word "dark" or
"light" accordingly, for use in setting 'background'.

The function does roughly the reverse of Vim's built-in heuristics to set the
'background' option, which default to a light background in the absence of
hints otherwise.

Note that this plugin does not inspect the value of the $TERM environment
variable or the |'term'| option at all, nor the |'t_RB'| option.

This plugin lives in Tom Ryder's "dotfiles" suite, and will eventually be spun
off into a separate distribution as it solidifies and this documentation
improves.