mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
doco: Replace termcap with terminfo where appropriate.
Also document better what to do on slow terminals.
This commit is contained in:
parent
76a6509c59
commit
756a17a848
@ -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:termresponse* *termresponse-variable*
|
||||
v:termresponse The escape sequence returned by the terminal for the |t_RV|
|
||||
termcap entry. It is set when Vim receives an escape sequence
|
||||
that starts with ESC [ or CSI and ends in a 'c', with only
|
||||
digits, ';' and '.' in between.
|
||||
v:termresponse The escape sequence returned by the terminal for the DA
|
||||
(request primary device attributes) control sequence. It is
|
||||
set when Vim receives an escape sequence that starts with ESC
|
||||
[ or CSI and ends in a 'c', with only digits, ';' and '.' in
|
||||
between.
|
||||
When this option is set, the TermResponse autocommand event is
|
||||
fired, so that you can react to the response from the
|
||||
terminal.
|
||||
|
@ -442,8 +442,8 @@ available on a few terminals.
|
||||
|
||||
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
|
||||
value, in which case this value is obtained from the termcap entry "kD". Both
|
||||
values have the same effect.
|
||||
value, in which case this value is obtained from the |terminfo| entry "key_dc".
|
||||
Both values have the same effect.
|
||||
|
||||
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
|
||||
|
@ -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
|
||||
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
|
||||
the key code for the key is in the termcap, it will automatically be
|
||||
translated into the internal code and become the second way of mapping
|
||||
the key code for the key is in the |terminfo| entry, it will automatically
|
||||
be translated into the internal code and become the second way of mapping
|
||||
(unless the 'k' flag is included in 'cpoptions').
|
||||
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
|
||||
|
@ -24,10 +24,7 @@ achieve special effects. These options come in three forms:
|
||||
|
||||
:se[t] all Show all but terminal options.
|
||||
|
||||
:se[t] termcap Show all terminal options. Note that in the GUI the
|
||||
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...
|
||||
:se[t] termcap Do nothing. Nvim uses |terminfo|.
|
||||
|
||||
*E518* *E519*
|
||||
:se[t] {option}? Show value of {option}.
|
||||
|
@ -571,8 +571,8 @@ In Insert or Command-line mode:
|
||||
*Q_op* Options
|
||||
|
||||
|:set| :se[t] show all modified options
|
||||
|:set| :se[t] all show all non-termcap options
|
||||
|:set| :se[t] termcap show all termcap options
|
||||
|:set| :se[t] all show all options
|
||||
|:set| :se[t] termcap Do nothing. (|terminfo|)
|
||||
|:set| :se[t] {option} set boolean option (switch it on),
|
||||
show string or number option
|
||||
|:set| :se[t] no{option} reset boolean option (switch it off)
|
||||
|
@ -4696,7 +4696,7 @@ cterm={attr-list} *highlight-cterm*
|
||||
ctermfg={color-nr} *highlight-ctermfg* *E421*
|
||||
ctermbg={color-nr} *highlight-ctermbg*
|
||||
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
|
||||
and its settings. Sometimes the color also depends on the settings of
|
||||
"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.
|
||||
|
||||
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"
|
||||
termcap entry |t_op|. If this doesn't work correctly, try setting the
|
||||
't_op' option in your vimrc.
|
||||
needs to reset the color when exiting. This is done with the
|
||||
"orig_pair" |terminfo| entry.
|
||||
*E419* *E420*
|
||||
When Vim knows the normal foreground and background colors, "fg" and
|
||||
"bg" can be used as color names. This only works after setting the
|
||||
|
@ -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.
|
||||
|
||||
*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*
|
||||
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
|
||||
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.
|
||||
|
||||
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",
|
||||
"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
|
||||
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
|
||||
@ -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)
|
||||
- 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
|
||||
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
|
||||
number.
|
||||
|
||||
If you have a slow terminal you may want to reset the 'showcmd' option.
|
||||
The command characters will not be shown in the status line. If the terminal
|
||||
scrolls very slowly, set the 'scrolljump' to 5 or so. If the cursor is moved
|
||||
off the screen (e.g., with "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 you have a slow terminal you may want to reset the 'showcmd' and 'ruler'
|
||||
options. The command characters and cursor poritions will not be shown in the
|
||||
status line (which involves a lot of cursor motions and attribute changes for
|
||||
every keypress or movement). If the terminal scrolls very slowly, set the
|
||||
'scrolljump' to 5 or so. If the cursor is moved off the screen (e.g., with
|
||||
"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
|
||||
between them you might want to set the 'timeout' and/or 'ttimeout' option.
|
||||
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
|
||||
This avoids that spaces are sent when they have different attributes. On most
|
||||
terminals you can't see this anyway.
|
||||
|
||||
If you are using Vim over a slow serial line, you might want to try running
|
||||
Vim inside the "screen" program. Screen will optimize the terminal I/O quite
|
||||
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.
|
||||
This draws the spaces with the default colours and attributes, which allows the
|
||||
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
|
||||
cursors and selections that cross them. This may have a visible, but minor,
|
||||
effect on some UIs.
|
||||
|
||||
==============================================================================
|
||||
Using the mouse *mouse-using*
|
||||
|
@ -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
|
||||
"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
|
||||
that have termcap codes for italics.
|
||||
that have |terminfo| capbilities for italics.
|
||||
|
||||
==============================================================================
|
||||
3. Opening and closing a window *opening-window* *E36*
|
||||
|
Loading…
Reference in New Issue
Block a user