-
Notifications
You must be signed in to change notification settings - Fork 23
On terminal emulators, colors, and typography
Romain Lafourcade edited this page Sep 23, 2022
·
2 revisions
- Typographic attributes are defined with the attributes
term=
for&t_Co == 0
andcterm=
for&t_Co >= 2
. -
bold
,reverse
andunderline
are widely supported so they can be used relatively safely. -
undercurl
andstrikethrough
are not widely supported so they shouldn't be a structural part of the colorscheme. -
italic
is theoretically widely supported but Vim can't currently detect its support in a cross-platform way so it must be used with caution.
- Default value for
XXX
$TERM. (WIP) -
cterm
,ctermbg
, andctermfg
are ignored. - Can only use typographic features (see above).
- Default value for
XXX
$TERM. (WIP) - When using color names,
red
/darkred
andblue
/darkblue
are inverted, as well asyellow
/darkyellow
andcyan
/darkcyan
:ctermbg=darkred
gives you adarkblue
background and so on. - When using color indices, colors are in the standard "xterm" order.
- Otherwise similar to
&t_Co == 8
.
- Default value for
xterm
,xterm-color
,ansi
,dtterm
,nsterm
,rxvt
,linux
$TERM. (WIP) - When using color names for
ctermbg
, only the "dark" variant is used:ctermbg=red
andctermbg=darkred
both work likectermbg=darkred
. - When using color indices for
ctermbg
, indices above 7 are ignored. - Color indices above 15 may be honored within the constraints of the terminal emulator:
ctermfg=211
may work if the terminal emulator supports 256 colors. It makes more sense to target 8c explicitly than to mix indices and hope for the best.
- Default value for
xterm-16color
$TERM. (WIP)
- Default value for
XXX
$TERM. (WIP)
- Default value for
xterm-256color
$TERM. (WIP) - Color indices 0-15 are generally user-customisable so they should be avoided.
- Color indices 16-255 are generally safe. It is possible for the user to change them but it is a lot more involved than for indices 0-15 so users are assumed to know about their situation and asked to adjust their expectations accordingly.
- X11/CSS Color names can be used for
ctermbg
andctermfg
but conversion to the 8bit color space is lossy (by definition) and poorly done by Vim anyway so color names must be avoided. - Vim incorrectly tries to convert the colors in
g:terminal_ansi_colors
. (add issue number)
-
&t_Co
is ignored. - If present, the values of
guibg
andguifg
are converted for use withctermbg
andctermfg
.