doco: Document constant 'term' in more detail.

Also expand the example in term-dependent-settings.
This commit is contained in:
Jonathan de Boyne Pollard
2017-06-16 15:57:19 +01:00
parent 702c94aacf
commit 5bdad50307
2 changed files with 19 additions and 4 deletions

View File

@@ -90,12 +90,22 @@ Settings depending on terminal *term-dependent-settings*
If you want to set options or mappings, depending on the terminal name, you If you want to set options or mappings, depending on the terminal name, you
can do this best in your init.vim. Example: > can do this best in your init.vim. Example: >
if $TERM =~ '^\(rxvt\|screen\)\(\|-.*\)' if $TERM =~ '^\(rxvt\|screen\|interix\|putty\)\(-.*\)\?$'
set notermguicolors set notermguicolors
elseif $TERM =~ '^\(xterm\|tmux\)\(\|-.*\)' elseif $TERM =~ '^\(tmux\|iterm\|vte\|gnome\)\(-.*\)\?$'
set termguicolors set termguicolors
elseif $TERM =~ '^\(xterm\)\(-.*\)\?$'
if $XTERM_VERSION != ''
set termguicolors
elseif $KONSOLE_PROFILE_NAME != ''
set termguicolors
elseif $VTE_VERSION != ''
set termguicolors
else
set notermguicolors
endif
elseif $TERM =~ ... elseif $TERM =~ ...
... and so forth ... ... and so forth ...
endif endif
< <
*scroll-region* *xterm-scroll-region* *scroll-region* *xterm-scroll-region*

View File

@@ -292,6 +292,12 @@ Nvim does not have special `t_XX` options nor <t_XX> keycodes to configure
terminal capabilities. Instead Nvim treats the terminal as any other UI. For terminal capabilities. Instead Nvim treats the terminal as any other UI. For
example, 'guicursor' sets the terminal cursor style if possible. example, 'guicursor' sets the terminal cursor style if possible.
*'term'* *E529* *E530* *E531*
The 'term' option has a fixed value, present only for script compatibility and
intentionally not the same as any known terminal type name. It should be a
rare case in Nvim where one needs |term-dependent-settings|, for which use the
|TERM| environment variable.
*termcap* *termcap*
Nvim never uses the termcap database and only uses |terminfo|. See Nvim never uses the termcap database and only uses |terminfo|. See
|builtin-terms| for what happens on operating systems without a terminfo |builtin-terms| for what happens on operating systems without a terminfo
@@ -346,7 +352,6 @@ Other options:
'shelltype' 'shelltype'
*'shortname'* *'sn'* *'noshortname'* *'nosn'* *'shortname'* *'sn'* *'noshortname'* *'nosn'*
*'swapsync'* *'sws'* *'swapsync'* *'sws'*
*'term'* *E529* *E530* *E531*
*'termencoding'* *'tenc'* (Vim 7.4.852 also removed this for Windows) *'termencoding'* *'tenc'* (Vim 7.4.852 also removed this for Windows)
'textauto' 'textauto'
'textmode' 'textmode'