patch 8.0.1108: cannot specify mappings for the terminal window
Problem: Cannot specify mappings for the terminal window.
Solution: Add the :tmap command and associated code. (Jacob Askeland,
closes #2073)
diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt
index 2c2275c..aad8e4a 100644
--- a/runtime/doc/terminal.txt
+++ b/runtime/doc/terminal.txt
@@ -1,4 +1,4 @@
-*terminal.txt* For Vim version 8.0. Last change: 2017 Sep 13
+*terminal.txt* For Vim version 8.0. Last change: 2017 Sep 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,7 +38,7 @@
Typing ~
-
+ *terminal-typing*
When the keyboard focus is in the terminal window, typed keys will be sent to
the job. This uses a pty when possible. You can click outside of the
terminal window to move keyboard focus elsewhere.
@@ -79,6 +79,10 @@
would end it. Other commands may ignore the SIGINT or handle the CTRL-C
themselves (like Vim does).
+To change the keys you type use terminal mode mappings, see |:tmap|.
+These are defined like any mapping, but apply only when typing keys that are
+sent to the job running in the terminal.
+
Size and color ~
@@ -221,6 +225,10 @@
Use CTRL-W N (or 'termkey' N) to switch to Terminal-Normal mode. Now the
contents of the terminal window is under control of Vim, the job output is
suspended. CTRL-\ CTRL-N does the same.
+
+Terminal-Job mode is where |tmap| mappings are applied. Keys sent by
+|term_sendkeys()| are not subject to tmap, but keys from |feedkeys()| are.
+
*E946*
In Terminal-Normal mode you can move the cursor around with the usual Vim
commands, Visually mark text, yank text, etc. But you cannot change the
@@ -301,7 +309,7 @@
Functions ~
-term_sendkeys() send keystrokes to a terminal
+term_sendkeys() send keystrokes to a terminal (not subject to tmap)
term_wait() wait for screen to be updated
term_scrape() inspect terminal screen