@@ -20,7 +20,8 @@ manual.
2020 1.8 Examples | map-examples |
2121 1.9 Using mappings | map-typing |
2222 1.10 Mapping alt-keys | :map-alt-keys |
23- 1.11 Mapping an operator | :map-operator |
23+ 1.11 Mapping in modifyOtherKeys mode | modifyOtherKeys |
24+ 1.12 Mapping an operator | :map-operator |
24252. Abbreviations | abbreviations |
25263. Local mappings and functions | script-local |
26274. User-defined commands | user-commands |
@@ -777,6 +778,9 @@ In the GUI Vim handles the Alt key itself, thus mapping keys with ALT should
777778always work. But in a terminal Vim gets a sequence of bytes and has to figure
778779out whether ALT was pressed or not.
779780
781+ If the terminal supports the modifyOtherKeys mode and it has been enabled,
782+ then Vim can recognize more key combinations, see | modifyOtherKeys | below.
783+
780784By default Vim assumes that pressing the ALT key sets the 8th bit of a typed
781785character. Most decent terminals can work that way, such as xterm, aterm and
782786rxvt. 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
814818using other applications but not when inside Vim.
815819
816820
817- 1.11 MAPPING AN OPERATOR *:map-operator*
821+ 1.11 MAPPING IN modifyOtherKeys mode *modifyOtherKeys*
822+
823+ Xterm and a few other terminals can be put in a mode where keys with modifiers
824+ are sent with a special escape code. Vim recognizes these codes and can then
825+ make a difference between CTRL-H and Backspace, even when Backspace sends the
826+ character 8. And many more special keys.
827+
828+ For xterm modifyOtherKeys is enabled in the builtin termcap entry. If this is
829+ not used you can enable modifyOtherKeys with these lines in your vimrc: >
830+ let &t_TI = "\<Esc>[>4;2m"
831+ let &t_TE = "\<Esc>[>4;m"
832+
833+ In case the modifyOtherKeys mode causes problems you can disable it: >
834+ let &t_TI = ""
835+ let &t_TE = ""
836+ It does not take effect immediately. To have this work without restarting Vim
837+ execute a shell command, e.g.: `! ls `
838+
839+ A known side effect effect is that in Insert mode the raw escape sequence is
840+ inserted after the CTRL-V key. This can be used to check whether
841+ modifyOtherKeys is enabled: In Insert mode type CTRL-V CTRL-V , if you get
842+ one byte then modifyOtherKeys is off, if you get <1b> 27;5;118~ then it is on.
843+
844+
845+ 1.12 MAPPING AN OPERATOR *:map-operator*
818846
819847An operator is used before a {motion} command. To define your own operator
820848you must create mapping that first sets the 'operatorfunc' option and then
0 commit comments