aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/term.txt
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
commit931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch)
treed8c1843a95da5ea0bb4acc09f7e37843d9995c86 /runtime/doc/term.txt
parent142d9041391780ac15b89886a54015fdc5c73995 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-userreg.tar.gz
rneovim-userreg.tar.bz2
rneovim-userreg.zip
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to 'runtime/doc/term.txt')
-rw-r--r--runtime/doc/term.txt44
1 files changed, 18 insertions, 26 deletions
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
index 847b4b6112..8ef8675d13 100644
--- a/runtime/doc/term.txt
+++ b/runtime/doc/term.txt
@@ -31,7 +31,7 @@ a non-superuser:
>
curl -LO https://invisible-island.net/datafiles/current/terminfo.src.gz
gunzip terminfo.src.gz
- tic terminfo.src
+ tic -x terminfo.src
<
*$TERM*
The $TERM environment variable must match the terminal you are using!
@@ -108,10 +108,22 @@ and right scroll margins as well. If Nvim detects that the terminal is Xterm,
it will make use of this ability to speed up scrolling that is not the full
width of the terminal.
- *tui-input*
+ *tui-input*
+Historically, terminal emulators could not distinguish between certain control
+key modifiers and other keys. For example, <C-I> and <Tab> are represented in
+the same way, as are <Esc> and <C-[>, <CR> and <C-M>, and <NL> and <C-J>.
+
+Modern terminal emulators are able to distinguish between these pairs of keys
+by encoding control modifiers differently. There are two common but distinct
+ways of doing this, known as "modifyOtherKeys" and "CSI u". Nvim supports both
+encoding methods and at startup will tell the terminal emulator that it
+understands these key encodings. If your terminal emulator supports it then
+this will allow you to map the key pairs listed above separately. |<Tab>|
+
Nvim uses libtermkey to convert terminal escape sequences to key codes.
|terminfo| is used first, and CSI sequences not in |terminfo| (including
-extended keys a.k.a. modifyOtherKeys or "CSI u") can also be parsed.
+extended keys a.k.a. "modifyOtherKeys" or "CSI u") can also be parsed.
+
For example, when running Nvim in tmux, this makes Nvim leave Insert mode and
go to the window below: >
tmux send-keys 'Escape' [ 2 7 u 'C-W' j
@@ -124,42 +136,22 @@ For example, this sequence is recognized by Nvim as <C-kEnter>: >
and can be used differently from <C-CR> in mappings.
*tui-modifyOtherKeys* *tui-csiu*
-Historically, terminal emulators could not distinguish between certain control
-key modifiers and other keys. For example, <C-I> and <Tab> are represented the
-same way, as are <Esc> and <C-[>, <CR> and <C-M>, and <NL> and <C-J>. This
-meant that Nvim also could not map these keys separately.
-
-Modern terminal emulators are able to distinguish between these pairs of keys
-by encoding control modifiers differently. There are two common but distinct
-ways of doing this, known as "modifyOtherKeys" and "CSI u". Nvim supports both
-encoding methods and at startup will tell the terminal emulator that it
-understands these key encodings. If your terminal emulator supports it then
-this will allow you to map the key pairs listed above separately.
-
-At startup Nvim will query your terminal to see if it supports the CSI u
+At startup Nvim will query your terminal to see if it supports the "CSI u"
encoding by writing the sequence >
-
CSI ? u CSI c
-
If your terminal emulator responds with >
-
CSI ? <flags> u
-
-this means your terminal supports the CSI u encoding and Nvim will tell your
+this means your terminal supports the "CSI u" encoding and Nvim will tell your
terminal to enable it by writing the sequence >
-
CSI > 1 u
-
-If your terminal does not support CSI u then Nvim will instead enable the
+If your terminal does not support "CSI u" then Nvim will instead enable the
"modifyOtherKeys" encoding by writing the sequence >
-
CSI > 4 ; 2 m
When Nvim exits cleanly it will send the corresponding sequence to disable the
special key encoding. If Nvim does not exit cleanly then your terminal
emulator could be in a bad state. If this happens, simply run "reset".
-
*tui-colors*
Nvim uses 256 colours by default, ignoring |terminfo| for most terminal types,
including "linux" (whose virtual terminals have had 256-colour support since