doco: Replace termcap with terminfo where appropriate.

Also document better what to do on slow terminals.
This commit is contained in:
Jonathan de Boyne Pollard 2017-05-25 20:43:48 +01:00
parent 76a6509c59
commit 756a17a848
8 changed files with 36 additions and 41 deletions

View File

@ -1845,10 +1845,11 @@ v:t_number Value of Number type. Read-only. See: |type()|
v:t_string Value of String type. Read-only. See: |type()| v:t_string Value of String type. Read-only. See: |type()|
*v:termresponse* *termresponse-variable* *v:termresponse* *termresponse-variable*
v:termresponse The escape sequence returned by the terminal for the |t_RV| v:termresponse The escape sequence returned by the terminal for the DA
termcap entry. It is set when Vim receives an escape sequence (request primary device attributes) control sequence. It is
that starts with ESC [ or CSI and ends in a 'c', with only set when Vim receives an escape sequence that starts with ESC
digits, ';' and '.' in between. [ or CSI and ends in a 'c', with only digits, ';' and '.' in
between.
When this option is set, the TermResponse autocommand event is When this option is set, the TermResponse autocommand event is
fired, so that you can react to the response from the fired, so that you can react to the response from the
terminal. terminal.

View File

@ -442,8 +442,8 @@ available on a few terminals.
Note: There are two codes for the delete key. 127 is the decimal ASCII value Note: There are two codes for the delete key. 127 is the decimal ASCII value
for the delete key, which is always recognized. Some delete keys send another for the delete key, which is always recognized. Some delete keys send another
value, in which case this value is obtained from the termcap entry "kD". Both value, in which case this value is obtained from the |terminfo| entry "key_dc".
values have the same effect. Both values have the same effect.
Note: The keypad keys are used in the same way as the corresponding "normal" Note: The keypad keys are used in the same way as the corresponding "normal"
keys. For example, <kHome> has the same effect as <Home>. If a keypad key keys. For example, <kHome> has the same effect as <Home>. If a keypad key

View File

@ -443,8 +443,8 @@ There are two ways to map a special key:
1. The Vi-compatible method: Map the key code. Often this is a sequence that 1. The Vi-compatible method: Map the key code. Often this is a sequence that
starts with <Esc>. To enter a mapping like this you type ":map " and then starts with <Esc>. To enter a mapping like this you type ":map " and then
you have to type CTRL-V before hitting the function key. Note that when you have to type CTRL-V before hitting the function key. Note that when
the key code for the key is in the termcap, it will automatically be the key code for the key is in the |terminfo| entry, it will automatically
translated into the internal code and become the second way of mapping be translated into the internal code and become the second way of mapping
(unless the 'k' flag is included in 'cpoptions'). (unless the 'k' flag is included in 'cpoptions').
2. The second method is to use the internal code for the function key. To 2. The second method is to use the internal code for the function key. To
enter such a mapping type CTRL-K and then hit the function key, or use enter such a mapping type CTRL-K and then hit the function key, or use

View File

@ -24,10 +24,7 @@ achieve special effects. These options come in three forms:
:se[t] all Show all but terminal options. :se[t] all Show all but terminal options.
:se[t] termcap Show all terminal options. Note that in the GUI the :se[t] termcap Do nothing. Nvim uses |terminfo|.
key codes are not shown, because they are generated
internally and can't be changed. Changing the terminal
codes in the GUI is not useful either...
*E518* *E519* *E518* *E519*
:se[t] {option}? Show value of {option}. :se[t] {option}? Show value of {option}.

View File

@ -571,8 +571,8 @@ In Insert or Command-line mode:
*Q_op* Options *Q_op* Options
|:set| :se[t] show all modified options |:set| :se[t] show all modified options
|:set| :se[t] all show all non-termcap options |:set| :se[t] all show all options
|:set| :se[t] termcap show all termcap options |:set| :se[t] termcap Do nothing. (|terminfo|)
|:set| :se[t] {option} set boolean option (switch it on), |:set| :se[t] {option} set boolean option (switch it on),
show string or number option show string or number option
|:set| :se[t] no{option} reset boolean option (switch it off) |:set| :se[t] no{option} reset boolean option (switch it off)

View File

@ -4696,7 +4696,7 @@ cterm={attr-list} *highlight-cterm*
ctermfg={color-nr} *highlight-ctermfg* *E421* ctermfg={color-nr} *highlight-ctermfg* *E421*
ctermbg={color-nr} *highlight-ctermbg* ctermbg={color-nr} *highlight-ctermbg*
The {color-nr} argument is a color number. Its range is zero to The {color-nr} argument is a color number. Its range is zero to
(not including) the number given by the termcap entry "Co". (not including) the number of |terminfo-colors| available.
The actual color with this number depends on the type of terminal The actual color with this number depends on the type of terminal
and its settings. Sometimes the color also depends on the settings of and its settings. Sometimes the color also depends on the settings of
"cterm". For example, on some systems "cterm=bold ctermfg=3" gives "cterm". For example, on some systems "cterm=bold ctermfg=3" gives
@ -4768,9 +4768,8 @@ ctermbg={color-nr} *highlight-ctermbg*
delete the "g:colors_name" variable when you don't want this. delete the "g:colors_name" variable when you don't want this.
When you have set "ctermfg" or "ctermbg" for the Normal group, Vim When you have set "ctermfg" or "ctermbg" for the Normal group, Vim
needs to reset the color when exiting. This is done with the "op" needs to reset the color when exiting. This is done with the
termcap entry |t_op|. If this doesn't work correctly, try setting the "orig_pair" |terminfo| entry.
't_op' option in your vimrc.
*E419* *E420* *E419* *E420*
When Vim knows the normal foreground and background colors, "fg" and When Vim knows the normal foreground and background colors, "fg" and
"bg" can be used as color names. This only works after setting the "bg" can be used as color names. This only works after setting the

View File

@ -21,7 +21,8 @@ When Vim is started a default terminal type is assumed. for MS-DOS this is
the pc terminal, for Unix an ansi terminal. the pc terminal, for Unix an ansi terminal.
*terminfo* *E557* *E558* *E559* *terminfo* *E557* *E558* *E559*
On Unix the terminfo database is used. On Unix the terminfo database is used. There is no access to the terminfo
settings with |:set|.
*builtin-terms* *builtin_terms* *builtin-terms* *builtin_terms*
If a terminfo database is not available, Nvim will look up the terminal type If a terminfo database is not available, Nvim will look up the terminal type
@ -65,7 +66,7 @@ genuine Xterm will not work over an SSH connection, because the environment
variable, set by genuine Xterm, that it looks for is not automatically variable, set by genuine Xterm, that it looks for is not automatically
replicated over an SSH login session. replicated over an SSH login session.
*256-color* *termcap-colors* *256-color* *terminfo-colors* *termcap-colors*
Nvim can make use of 256-colour terminals and tries to do so whereever it can. Nvim can make use of 256-colour terminals and tries to do so whereever it can.
If the |terminfo| description of the terminal says that it supports fewer If the |terminfo| description of the terminal says that it supports fewer
@ -93,7 +94,7 @@ extension pioneered by the dtterm program. |terminfo| does not have a flag
for this extension. So Nvim simply assumes that (all) "dtterm", "xterm", for this extension. So Nvim simply assumes that (all) "dtterm", "xterm",
"teraterm", "rxvt" terminal types, and Konsole, are capable of this. "teraterm", "rxvt" terminal types, and Konsole, are capable of this.
*cursor-shape* *termcap-cursor-shape* *cursor-shape* *terminfo-cursor-shape* *termcap-cursor-shape*
Nvim will adjust the shape of the cursor from a block to a line when in insert Nvim will adjust the shape of the cursor from a block to a line when in insert
mode (or as specified by the 'guicursor' option), on terminals that support mode (or as specified by the 'guicursor' option), on terminals that support
it. It uses the same |terminfo| extensions that were pioneered by tmux for it. It uses the same |terminfo| extensions that were pioneered by tmux for
@ -167,7 +168,7 @@ On Unix systems, three methods are tried to get the window size:
- an ioctl call (TIOCGSIZE or TIOCGWINSZ, depends on your system) - an ioctl call (TIOCGSIZE or TIOCGWINSZ, depends on your system)
- the environment variables "LINES" and "COLUMNS" - the environment variables "LINES" and "COLUMNS"
- from the termcap entries "li" and "co" - from the |terminfo| entries "lines" and "columns"
If everything fails a default size of 24 lines and 80 columns is assumed. If If everything fails a default size of 24 lines and 80 columns is assumed. If
a window-resize signal is received the size will be set again. If the window a window-resize signal is received the size will be set again. If the window
@ -190,30 +191,27 @@ cursor position is shown in the status line. If you are using horizontal
scrolling ('wrap' option off) consider setting 'sidescroll' to a small scrolling ('wrap' option off) consider setting 'sidescroll' to a small
number. number.
If you have a slow terminal you may want to reset the 'showcmd' option. If you have a slow terminal you may want to reset the 'showcmd' and 'ruler'
The command characters will not be shown in the status line. If the terminal options. The command characters and cursor poritions will not be shown in the
scrolls very slowly, set the 'scrolljump' to 5 or so. If the cursor is moved status line (which involves a lot of cursor motions and attribute changes for
off the screen (e.g., with "j") Vim will scroll 5 lines at a time. Another every keypress or movement). If the terminal scrolls very slowly, set the
possibility is to reduce the number of lines that Vim uses with the command 'scrolljump' to 5 or so. If the cursor is moved off the screen (e.g., with
"z{height}<CR>". "j") Vim will scroll 5 lines at a time. Another possibility is to reduce the
number of lines that Vim uses with the command "z{height}<CR>".
If the characters from the terminal are arriving with more than 1 second If the characters from the terminal are arriving with more than 1 second
between them you might want to set the 'timeout' and/or 'ttimeout' option. between them you might want to set the 'timeout' and/or 'ttimeout' option.
See the "Options" chapter |options|. See the "Options" chapter |options|.
If you are using a color terminal that is slow, use this command: > If you are using a color terminal that is slow when displaying lines beyond
the end of a buffer, this is because Nvim is drawing the whitespace twice, in
two sets of colours and attributes. To prevent this, use this command: >
hi NonText cterm=NONE ctermfg=NONE hi NonText cterm=NONE ctermfg=NONE
This avoids that spaces are sent when they have different attributes. On most This draws the spaces with the default colours and attributes, which allows the
terminals you can't see this anyway. second pass of drawing to be optimized away. Note: Although in theory the
colours of whitespace are immaterial, in practice they change the colours of
If you are using Vim over a slow serial line, you might want to try running cursors and selections that cross them. This may have a visible, but minor,
Vim inside the "screen" program. Screen will optimize the terminal I/O quite effect on some UIs.
a bit.
If you are testing termcap options, but you cannot see what is happening,
you might want to set the 'writedelay' option. When non-zero, one character
is sent to the terminal at a time (does not work for MS-DOS). This makes the
screen updating a lot slower, making it possible to see what is happening.
============================================================================== ==============================================================================
Using the mouse *mouse-using* Using the mouse *mouse-using*

View File

@ -117,7 +117,7 @@ check if the 'highlight' option contains "si". In version 3.0, this meant to
invert the status line. Now it should be "sr", reverse the status line, as invert the status line. Now it should be "sr", reverse the status line, as
"si" now stands for italic! If italic is not available on your terminal, the "si" now stands for italic! If italic is not available on your terminal, the
status line is inverted anyway; you will only see this problem on terminals status line is inverted anyway; you will only see this problem on terminals
that have termcap codes for italics. that have |terminfo| capbilities for italics.
============================================================================== ==============================================================================
3. Opening and closing a window *opening-window* *E36* 3. Opening and closing a window *opening-window* *E36*