diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-20 19:53:22 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-20 19:53:22 +0200 |
commit | 4b57018ee4e6d608e3a28e0ee4fdd2f057cc0e89 (patch) | |
tree | 3e96f99901a64eda318dbc42e127ed6b717be26f /runtime/doc/map.txt | |
parent | a13961536e5b1e686574826d4ed713e3d5526715 (diff) | |
download | vim-git-4b57018ee4e6d608e3a28e0ee4fdd2f057cc0e89.tar.gz |
patch 8.1.2194: modifyOtherKeys is not enabled by defaultv8.1.2194
Problem: ModifyOtherKeys is not enabled by default.
Solution: Add t_TI and t_TE to the builtin xterm termcap.
Diffstat (limited to 'runtime/doc/map.txt')
-rw-r--r-- | runtime/doc/map.txt | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index bdf5e9755..daa1cf2cc 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -20,7 +20,8 @@ manual. 1.8 Examples |map-examples| 1.9 Using mappings |map-typing| 1.10 Mapping alt-keys |:map-alt-keys| - 1.11 Mapping an operator |:map-operator| + 1.11 Mapping in modifyOtherKeys mode |modifyOtherKeys| + 1.12 Mapping an operator |:map-operator| 2. Abbreviations |abbreviations| 3. Local mappings and functions |script-local| 4. User-defined commands |user-commands| @@ -777,6 +778,9 @@ In the GUI Vim handles the Alt key itself, thus mapping keys with ALT should always work. But in a terminal Vim gets a sequence of bytes and has to figure out whether ALT was pressed or not. +If the terminal supports the modifyOtherKeys mode and it has been enabled, +then Vim can recognize more key combinations, see |modifyOtherKeys| below. + By default Vim assumes that pressing the ALT key sets the 8th bit of a typed character. Most decent terminals can work that way, such as xterm, aterm and rxvt. If your <A-k> mappings don't work it might be that the terminal is @@ -814,7 +818,31 @@ on the terminal; that's a good last resource in case you want to send ESC when using other applications but not when inside Vim. -1.11 MAPPING AN OPERATOR *:map-operator* +1.11 MAPPING IN modifyOtherKeys mode *modifyOtherKeys* + +Xterm and a few other terminals can be put in a mode where keys with modifiers +are sent with a special escape code. Vim recognizes these codes and can then +make a difference between CTRL-H and Backspace, even when Backspace sends the +character 8. And many more special keys. + +For xterm modifyOtherKeys is enabled in the builtin termcap entry. If this is +not used you can enable modifyOtherKeys with these lines in your vimrc: > + let &t_TI = "\<Esc>[>4;2m" + let &t_TE = "\<Esc>[>4;m" + +In case the modifyOtherKeys mode causes problems you can disable it: > + let &t_TI = "" + let &t_TE = "" +It does not take effect immediately. To have this work without restarting Vim +execute a shell command, e.g.: `!ls` + +A known side effect effect is that in Insert mode the raw escape sequence is +inserted after the CTRL-V key. This can be used to check whether +modifyOtherKeys is enabled: In Insert mode type CTRL-V CTRL-V, if you get +one byte then modifyOtherKeys is off, if you get <1b>27;5;118~ then it is on. + + +1.12 MAPPING AN OPERATOR *:map-operator* An operator is used before a {motion} command. To define your own operator you must create mapping that first sets the 'operatorfunc' option and then |