/usr/share/doc/vim/html/term.html is in vim-doc 2:8.0.1453-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 | <HTML>
<HEAD>
<META HTTP-EQUIV="Content-type" content="text/html; charset=ISO-8859-1">
<TITLE>Vim documentation: term</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>Vim documentation: term</H1>
<A NAME="top"></A>
<A HREF="index.html">main help file</A>
<HR>
<PRE>
*<A NAME="term.txt"></A><B>term.txt</B>* For Vim version 8.0. Last change: 2017 Oct 14
VIM REFERENCE MANUAL by <A HREF="intro.html#Bram">Bram</A> <A HREF="intro.html#Moolenaar">Moolenaar</A>
Terminal information *<A NAME="terminal-info"></A><B>terminal-info</B>*
Vim uses information about the <A HREF="terminal.html#terminal">terminal</A> you are using to fill the screen and
recognize what keys you hit. If this information is not correct, the screen
may be messed up or keys may not be recognized. The actions which have to be
performed on the screen are accomplished by outputting a <A HREF="eval.html#string">string</A> of
characters. <A HREF="eval.html#Special">Special</A> keys produce a <A HREF="eval.html#string">string</A> of characters. These strings are
stored in the terminal options, see |<A HREF="#terminal-options">terminal-options</A>|.
NOTE: Most of this is not used when running the |<A HREF="gui.html#GUI">GUI</A>|.
1. Startup |<A HREF="#startup-terminal">startup-terminal</A>|
2. Terminal options |<A HREF="#terminal-options">terminal-options</A>|
3. Window size |<A HREF="#window-size">window-size</A>|
4. Slow and fast terminals |<A HREF="#slow-fast-terminal">slow-fast-terminal</A>|
5. Using the mouse |<A HREF="#mouse-using">mouse-using</A>|
==============================================================================
1. Startup *<A NAME="startup-terminal"></A><B>startup-terminal</B>*
When Vim is started a default <A HREF="terminal.html#terminal">terminal</A> type is assumed. For the <A HREF="os_amiga.html#Amiga">Amiga</A> this is
a standard CLI <A HREF="windows.html#window">window</A>, for <A HREF="os_msdos.html#MS-DOS">MS-DOS</A> the pc <A HREF="terminal.html#terminal">terminal</A>, for <A HREF="os_unix.html#Unix">Unix</A> an ansi <A HREF="terminal.html#terminal">terminal</A>.
A few other <A HREF="terminal.html#terminal">terminal</A> types are always available, see below |<A HREF="#builtin-terms">builtin-terms</A>|.
You can give the <A HREF="terminal.html#terminal">terminal</A> name with the '<A HREF="starting.html#-T">-T</A>' Vim argument. If <A HREF="motion.html#it">it</A> is not given
Vim will try to get the name from the <A HREF="starting.html#TERM">TERM</A> environment variable.
*<A NAME="termcap"></A><B>termcap</B>* *<A NAME="terminfo"></A><B>terminfo</B>* *<A NAME="E557"></A><B>E557</B>* *<A NAME="E558"></A><B>E558</B>* *<A NAME="E559"></A><B>E559</B>*
On <A HREF="os_unix.html#Unix">Unix</A> the <A HREF="#terminfo">terminfo</A> database or <A HREF="#termcap">termcap</A> file is used. This is referred to <A HREF="motion.html#as">as</A>
"<A HREF="#termcap">termcap</A>" in all the documentation. At compile time, when running configure,
the choice whether to use <A HREF="#terminfo">terminfo</A> or <A HREF="#termcap">termcap</A> is done automatically. When
running Vim the output of "<A HREF="various.html#:version">:version</A>" will show |<A HREF="various.html#+terminfo">+terminfo</A>| if terminfo is
used. Also see |<A HREF="tips.html#xterm-screens">xterm-screens</A>|.
On non-Unix systems a <A HREF="#termcap">termcap</A> is only available if Vim was compiled with
TERMCAP defined.
*<A NAME="builtin-terms"></A><B>builtin-terms</B>* *<A NAME="builtin_terms"></A><B>builtin_terms</B>*
Which builtin terminals are available depends on a few defines in feature.h,
which need to be set at compile time:
<B><FONT COLOR="PURPLE"> define output of ":version" terminals builtin </FONT></B>
NO_BUILTIN_TCAPS -builtin_terms none
SOME_BUILTIN_TCAPS <A HREF="various.html#+builtin_terms">+builtin_terms</A> most common ones (default)
ALL_BUILTIN_TCAPS <A HREF="various.html#++builtin_terms">++builtin_terms</A> all available
You can see a <A HREF="eval.html#list">list</A> of available builtin terminals with "<A HREF="options.html#:set">:set</A> <A HREF="options.html#'term'">term</A>=xxx" (when
not running the <A HREF="gui.html#GUI">GUI</A>). Also see |<A HREF="various.html#+builtin_terms">+builtin_terms</A>|.
If the <A HREF="#termcap">termcap</A> code is included Vim will try to get the strings for the
<A HREF="terminal.html#terminal">terminal</A> you are using from the <A HREF="#termcap">termcap</A> file and the builtin termcaps. Both
are always used, if an entry for the <A HREF="terminal.html#terminal">terminal</A> you are using is present. Which
one is used first depends on the <A HREF="options.html#'ttybuiltin'">'ttybuiltin'</A> option:
<A HREF="options.html#'ttybuiltin'">'ttybuiltin'</A> on 1: builtin <A HREF="#termcap">termcap</A> 2: external <A HREF="#termcap">termcap</A>
<A HREF="options.html#'ttybuiltin'">'ttybuiltin'</A> off 1: external <A HREF="#termcap">termcap</A> 2: builtin <A HREF="#termcap">termcap</A>
If an option is missing in one of them, <A HREF="motion.html#it">it</A> will be obtained from the other
one. If an option is present in both, the one first encountered is used.
Which external <A HREF="#termcap">termcap</A> file is used varies from system to system and may
depend on the environment <A HREF="eval.html#variables">variables</A> "TERMCAP" and "TERMPATH". See "man
tgetent".
Settings depending on <A HREF="terminal.html#terminal">terminal</A> *<A NAME="term-dependent-settings"></A><B>term-dependent-settings</B>*
If you want to set <A HREF="options.html#options">options</A> or mappings, depending on the <A HREF="terminal.html#terminal">terminal</A> name, you
can <A HREF="diff.html#do">do</A> this best in your <A HREF="starting.html#.vimrc">.vimrc</A>. Example:
<B> if &term == "xterm"</B>
<B> ... xterm maps and settings ...</B>
<B> elseif &term =~ "vt10."</B>
<B> ... vt100, vt102 maps and settings ...</B>
<B> endif</B>
*<A NAME="raw-terminal-mode"></A><B>raw-terminal-mode</B>*
For normal editing the <A HREF="terminal.html#terminal">terminal</A> will be put into "raw" mode. The strings
defined with <A HREF="#'t_ti'">'t_ti'</A> and <A HREF="#'t_ks'">'t_ks'</A> will be sent to the <A HREF="terminal.html#terminal">terminal</A>. Normally this
puts the <A HREF="terminal.html#terminal">terminal</A> in a state where the <A HREF="#termcap">termcap</A> codes are valid and activates
the cursor and function keys. When Vim exits the <A HREF="terminal.html#terminal">terminal</A> will be put back
into the mode <A HREF="motion.html#it">it</A> was before Vim started. The strings defined with <A HREF="#'t_te'">'t_te'</A> and
<A HREF="#'t_ke'">'t_ke'</A> will be sent to the <A HREF="terminal.html#terminal">terminal</A>. On the <A HREF="os_amiga.html#Amiga">Amiga</A>, with commands that execute
an external command (e.g., "!!"), the <A HREF="terminal.html#terminal">terminal</A> will be put into <A HREF="intro.html#Normal">Normal</A> mode
for a moment. This means that you can stop the output to the screen by
hitting a <A HREF="print.html#printing">printing</A> key. Output resumes when you hit <A HREF="motion.html#<BS>"><BS></A>.
*<A NAME="xterm-bracketed-paste"></A><B>xterm-bracketed-paste</B>*
When the <A HREF="#'t_BE'">'t_BE'</A> option is set then <A HREF="#'t_BE'">'t_BE'</A> will be sent to the
<A HREF="terminal.html#terminal">terminal</A> when entering "raw" mode and <A HREF="#'t_BD'">'t_BD'</A> when leaving "raw" mode. The
<A HREF="terminal.html#terminal">terminal</A> is then expected to put <A HREF="#'t_PS'">'t_PS'</A> before pasted text and <A HREF="#'t_PE'">'t_PE'</A> after
pasted text. This way Vim can separate text that is pasted from characters
that are typed. The pasted text is handled like when the middle mouse button
is used, <A HREF="motion.html#it">it</A> is inserted literally and not interpreted <A HREF="motion.html#as">as</A> commands.
When the cursor is in the first column, the pasted text will be inserted
before <A HREF="motion.html#it">it</A>. Otherwise the pasted text is appended after the cursor position.
This means one cannot paste after the first column. Unfortunately Vim does
not have a way to tell where the mouse pointer was.
Note that in some situations Vim will not recognize the bracketed paste and
you will get the raw text. In other situations Vim will only get the first
pasted character and drop the rest, e.g. when using the "<A HREF="change.html#r">r</A>" command. If you
have a problem with this, disable bracketed paste by putting this in your
<A HREF="starting.html#.vimrc">.vimrc</A>:
<B> set t_BE=</B>
If this is done while Vim is running the <A HREF="#'t_BD'">'t_BD'</A> will be sent to the <A HREF="terminal.html#terminal">terminal</A>
to disable bracketed paste.
*<A NAME="cs7-problem"></A><B>cs7-problem</B>*
Note: If the <A HREF="terminal.html#terminal">terminal</A> settings are changed after running Vim, you might have
an illegal combination of settings. This has been reported on Solaris 2.5
with "stty cs8 parenb", which is restored <A HREF="motion.html#as">as</A> "stty cs7 parenb". Use
"stty cs8 -parenb -istrip" instead, this is restored correctly.
Some <A HREF="#termcap">termcap</A> entries are wrong in the sense that after sending <A HREF="#'t_ks'">'t_ks'</A> the
cursor keys send codes different from the codes defined in the <A HREF="#termcap">termcap</A>. To
avoid this you can set <A HREF="#'t_ks'">'t_ks'</A> (and <A HREF="#'t_ke'">'t_ke'</A>) to empty strings. This must be
done during initialization (see |<A HREF="starting.html#initialization">initialization</A>|), otherwise it's too late.
Some <A HREF="#termcap">termcap</A> entries assume that the highest bit is always reset. For
example: The <A HREF="intro.html#cursor-up">cursor-up</A> entry for the <A HREF="os_amiga.html#Amiga">Amiga</A> could be ":ku=\E[A:". But the
<A HREF="os_amiga.html#Amiga">Amiga</A> really sends "\233A". This works fine if the highest bit is reset,
e.g., when using an <A HREF="os_amiga.html#Amiga">Amiga</A> over a serial line. If the cursor keys don't work,
try the entry ":ku=\233A:".
Some <A HREF="#termcap">termcap</A> entries have the entry ":ku=\E[A:". But the <A HREF="os_amiga.html#Amiga">Amiga</A> really sends
"\233A". On output "\E[" and "\233" are often equivalent, on input they
aren't. You will have to change the <A HREF="#termcap">termcap</A> entry, or change the key code with
the <A HREF="options.html#:set">:set</A> command to fix this.
Many cursor key codes start with an <A HREF="intro.html#<Esc>"><Esc></A>. Vim must find out if this is a
single hit of the <A HREF="intro.html#<Esc>"><Esc></A> key or the start of a cursor key sequence. It waits
for a next character to arrive. If <A HREF="motion.html#it">it</A> does not arrive within one second a
single <A HREF="intro.html#<Esc>"><Esc></A> is assumed. On very slow systems this may fail, causing cursor
keys not to work sometimes. If you discover this problem reset the <A HREF="options.html#'timeout'">'timeout'</A>
option. Vim will wait for the next character to arrive after an <A HREF="intro.html#<Esc>"><Esc></A>. If
you want to enter a single <A HREF="intro.html#<Esc>"><Esc></A> you must type <A HREF="motion.html#it">it</A> <A HREF="if_cscop.html#twice">twice</A>. Resetting the
<A HREF="options.html#'esckeys'">'esckeys'</A> option avoids this problem in <A HREF="insert.html#Insert">Insert</A> mode, but you lose the
possibility to use cursor and function keys in <A HREF="insert.html#Insert">Insert</A> mode.
On the <A HREF="os_amiga.html#Amiga">Amiga</A> the recognition of <A HREF="windows.html#window">window</A> resizing is activated only when the
<A HREF="terminal.html#terminal">terminal</A> name is "amiga" or "builtin_amiga".
Some terminals have confusing codes for the cursor keys. The televideo 925 is
such a <A HREF="terminal.html#terminal">terminal</A>. It sends a <A HREF="motion.html#CTRL-H">CTRL-H</A> for <A HREF="intro.html#cursor-left">cursor-left</A>. This would make <A HREF="motion.html#it">it</A>
impossible to distinguish a backspace and <A HREF="intro.html#cursor-left">cursor-left</A>. To avoid this problem
<A HREF="motion.html#CTRL-H">CTRL-H</A> is never recognized <A HREF="motion.html#as">as</A> <A HREF="intro.html#cursor-left">cursor-left</A>.
*<A NAME="vt100-cursor-keys"></A><B>vt100-cursor-keys</B>* *<A NAME="xterm-cursor-keys"></A><B>xterm-cursor-keys</B>*
Other terminals (e.g., vt100 and xterm) have cursor keys that send <Esc>OA,
<Esc>OB, etc. Unfortunately these are valid commands in insert mode: Stop
insert, Open a new line above the new one, start <A HREF="insert.html#inserting">inserting</A> '<A HREF="insert.html#A">A</A>', '<A HREF="motion.html#B">B</A>', etc.
Instead of performing these commands Vim will erroneously recognize this typed
key sequence <A HREF="motion.html#as">as</A> a cursor key <A HREF="intro.html#movement">movement</A>. To avoid this and make Vim <A HREF="diff.html#do">do</A> what you
want in either <A HREF="change.html#case">case</A> you could use these settings:
<B> :set notimeout " don't timeout on mappings</B>
<B> :set ttimeout " do timeout on terminal key codes</B>
<B> :set timeoutlen=100 " timeout after 100 msec</B>
This requires the <A HREF="intro.html#key-codes">key-codes</A> to be sent within 100 msec in order to recognize
them <A HREF="motion.html#as">as</A> a cursor key. When you type you normally are not that fast, so they
are recognized <A HREF="motion.html#as">as</A> individual typed commands, even though Vim receives the same
sequence of bytes.
*<A NAME="vt100-function-keys"></A><B>vt100-function-keys</B>* *<A NAME="xterm-function-keys"></A><B>xterm-function-keys</B>*
An xterm can send function keys F1 to F4 in two modes: vt100 compatible or
not. Because Vim may not know what the xterm is sending, both types of keys
are recognized. The same happens for the <A HREF="motion.html#<Home>"><Home></A> and <A HREF="motion.html#<End>"><End></A> keys.
<B><FONT COLOR="PURPLE"> normal vt100 </FONT></B>
<A HREF="helphelp.html#<F1>"><F1></A> <A HREF="#t_k1">t_k1</A> <Esc>[11~ <A HREF="#<xF1>"><xF1></A> <Esc>OP *<A NAME="<xF1>-xterm"></A><B><xF1>-xterm</B>*
<A HREF="#<F2>"><F2></A> <A HREF="#t_k2">t_k2</A> <Esc>[12~ <A HREF="#<xF2>"><xF2></A> <Esc>OQ *<A NAME="<xF2>-xterm"></A><B><xF2>-xterm</B>*
<A HREF="#<F3>"><F3></A> <A HREF="#t_k3">t_k3</A> <Esc>[13~ <A HREF="#<xF3>"><xF3></A> <Esc>OR *<A NAME="<xF3>-xterm"></A><B><xF3>-xterm</B>*
<A HREF="#<F4>"><F4></A> <A HREF="#t_k4">t_k4</A> <Esc>[14~ <A HREF="#<xF4>"><xF4></A> <Esc>OS *<A NAME="<xF4>-xterm"></A><B><xF4>-xterm</B>*
<A HREF="motion.html#<Home>"><Home></A> <A HREF="#t_kh">t_kh</A> <Esc>[7~ <A HREF="#<xHome>"><xHome></A> <Esc>OH *<A NAME="<xHome>-xterm"></A><B><xHome>-xterm</B>*
<A HREF="motion.html#<End>"><End></A> <A HREF="#t_@7">t_@7</A> <Esc>[4~ <A HREF="#<xEnd>"><xEnd></A> <Esc>OF *<A NAME="<xEnd>-xterm"></A><B><xEnd>-xterm</B>*
When Vim starts, <A HREF="#<xF1>"><xF1></A> is mapped to <A HREF="helphelp.html#<F1>"><F1></A>, <A HREF="#<xF2>"><xF2></A> to <A HREF="#<F2>"><F2></A> etc. This means that
by default both codes <A HREF="diff.html#do">do</A> the same thing. If you make a <A HREF="map.html#mapping">mapping</A> for <A HREF="#<xF2>"><xF2></A>,
because your <A HREF="terminal.html#terminal">terminal</A> does have two keys, the default <A HREF="map.html#mapping">mapping</A> is overwritten,
thus you can use the <A HREF="#<F2>"><F2></A> and <A HREF="#<xF2>"><xF2></A> keys for something different.
*<A NAME="xterm-shifted-keys"></A><B>xterm-shifted-keys</B>*
Newer versions of xterm support shifted function keys and special keys. Vim
recognizes most of them. Use "<A HREF="options.html#:set">:set</A> <A HREF="#termcap">termcap</A>" to check which are supported and
what the codes are. Mostly these are not in a <A HREF="#termcap">termcap</A>, they are only
supported by the builtin_xterm <A HREF="#termcap">termcap</A>.
*<A NAME="xterm-modifier-keys"></A><B>xterm-modifier-keys</B>*
Newer versions of xterm support Alt and Ctrl for most function keys. To avoid
having to add all combinations of Alt, Ctrl and Shift for every key a special
sequence is recognized at the end of a <A HREF="#termcap">termcap</A> entry: ";*X". The "<A HREF="change.html#X">X</A>" can be
any character, often '<A HREF="change.html#~">~</A>' is used. The ";*" stands for an optional modifier
argument. ";2" is Shift, ";3" is Alt, ";5" is Ctrl and ";9" is Meta (when
it's different from Alt). They can be combined. Examples:
<B> :set <F8>=^[[19;*~</B>
<B> :set <Home>=^[[1;*H</B>
Another speciality about these codes is that they are not overwritten by
another code. That is to avoid that the codes obtained from xterm directly
|<A HREF="#t_RV">t_RV</A>| overwrite them.
*<A NAME="xterm-scroll-region"></A><B>xterm-scroll-region</B>*
The default <A HREF="#termcap">termcap</A> entry for xterm on Sun and other platforms does not
contain the entry for scroll regions. Add ":cs=\E[%i%d;%dr:" to the xterm
entry in /etc/termcap and everything should work.
*<A NAME="xterm-end-home-keys"></A><B>xterm-end-home-keys</B>*
On some systems (at least on FreeBSD with XFree86 3.1.2) the codes that the
<A HREF="motion.html#<End>"><End></A> and <A HREF="motion.html#<Home>"><Home></A> keys send contain a <A HREF="intro.html#<Nul>"><Nul></A> character. To make these keys send
the proper key code, add these lines to your ~/.Xdefaults file:
*VT100.Translations: #override \n\
<Key>Home: string("0x1b") string("[7~") \n\
<Key>End: string("0x1b") string("[8~")
*<A NAME="xterm-8bit"></A><B>xterm-8bit</B>* *<A NAME="xterm-8-bit"></A><B>xterm-8-bit</B>*
Xterm can be run in a mode where <A HREF="motion.html#it">it</A> uses 8-bit <A HREF="intro.html#escape">escape</A> sequences. The CSI code
is used instead of <Esc>[. The advantage is that an <A HREF="intro.html#<Esc>"><Esc></A> can quickly be
recognized in <A HREF="insert.html#Insert">Insert</A> mode, because <A HREF="motion.html#it">it</A> can't be confused with the start of a
special key.
For the builtin <A HREF="#termcap">termcap</A> entries, Vim checks if the <A HREF="options.html#'term'">'term'</A> option contains
"8bit" anywhere. It then uses 8-bit characters for the <A HREF="#termcap">termcap</A> entries, the
mouse and a few other things. You would normally set $TERM in your shell to
"<A HREF="#xterm-8bit">xterm-8bit</A>" and Vim picks this up and adjusts to the 8-bit setting
automatically.
When Vim receives a response to the |<A HREF="#t_RV">t_RV</A>| (request version) sequence and <A HREF="motion.html#it">it</A>
starts with CSI, <A HREF="motion.html#it">it</A> assumes that the <A HREF="terminal.html#terminal">terminal</A> is in 8-bit mode and will
convert all key sequences to their 8-bit variants.
==============================================================================
2. Terminal <A HREF="options.html#options">options</A> *<A NAME="terminal-options"></A><B>terminal-options</B>* *<A NAME="termcap-options"></A><B>termcap-options</B>* *<A NAME="E436"></A><B>E436</B>*
The <A HREF="terminal.html#terminal">terminal</A> <A HREF="options.html#options">options</A> can be set just like normal <A HREF="options.html#options">options</A>. But they are not
shown with the "<A HREF="options.html#:set">:set</A> all" command. Instead use "<A HREF="options.html#:set">:set</A> <A HREF="#termcap">termcap</A>"
It is always possible to change individual strings by setting the
appropriate option. For example:
<B> :set t_ce=^V^[[K (CTRL-V, <Esc>, [, K)</B>
{Vi: no <A HREF="terminal.html#terminal">terminal</A> <A HREF="options.html#options">options</A>. You have to exit <A HREF="intro.html#Vi">Vi</A>, edit the <A HREF="#termcap">termcap</A> entry and
try again}
The <A HREF="options.html#options">options</A> are listed below. The associated <A HREF="#termcap">termcap</A> code is always equal to
the last two characters of the option name. Only one <A HREF="#termcap">termcap</A> code is
required: Cursor motion, <A HREF="#'t_cm'">'t_cm'</A>.
The <A HREF="options.html#options">options</A> <A HREF="#'t_da'">'t_da'</A>, <A HREF="#'t_db'">'t_db'</A>, <A HREF="#'t_ms'">'t_ms'</A>, <A HREF="#'t_xs'">'t_xs'</A>, <A HREF="#'t_xn'">'t_xn'</A> represent flags in the
<A HREF="#termcap">termcap</A>. When the <A HREF="#termcap">termcap</A> flag is present, the option will be set to "<A HREF="change.html#y">y</A>".
But any non-empty <A HREF="eval.html#string">string</A> means that the flag is set. An empty <A HREF="eval.html#string">string</A> means
that the flag is not set. <A HREF="#'t_CS'">'t_CS'</A> works like this too, but <A HREF="motion.html#it">it</A> isn't a <A HREF="#termcap">termcap</A>
flag.
OUTPUT CODES *<A NAME="terminal-output-codes"></A><B>terminal-output-codes</B>*
<B><FONT COLOR="PURPLE"> option meaning </FONT></B>
<A HREF="#t_AB">t_AB</A> set background color (ANSI) *<A NAME="t_AB"></A><B>t_AB</B>* *<A NAME="'t_AB'"></A><B>'t_AB'</B>*
<A HREF="#t_AF">t_AF</A> set foreground color (ANSI) *<A NAME="t_AF"></A><B>t_AF</B>* *<A NAME="'t_AF'"></A><B>'t_AF'</B>*
<A HREF="#t_AL">t_AL</A> add number of blank lines *<A NAME="t_AL"></A><B>t_AL</B>* *<A NAME="'t_AL'"></A><B>'t_AL'</B>*
<A HREF="#t_al">t_al</A> add new blank line *<A NAME="t_al"></A><B>t_al</B>* *<A NAME="'t_al'"></A><B>'t_al'</B>*
<A HREF="#t_bc">t_bc</A> backspace character *<A NAME="t_bc"></A><B>t_bc</B>* *<A NAME="'t_bc'"></A><B>'t_bc'</B>*
<A HREF="#t_cd">t_cd</A> clear to end of screen *<A NAME="t_cd"></A><B>t_cd</B>* *<A NAME="'t_cd'"></A><B>'t_cd'</B>*
<A HREF="#t_ce">t_ce</A> clear to end of line *<A NAME="t_ce"></A><B>t_ce</B>* *<A NAME="'t_ce'"></A><B>'t_ce'</B>*
<A HREF="#t_cl">t_cl</A> clear screen *<A NAME="t_cl"></A><B>t_cl</B>* *<A NAME="'t_cl'"></A><B>'t_cl'</B>*
<A HREF="#t_cm">t_cm</A> cursor motion (required!) *<A NAME="E437"></A><B>E437</B>* *<A NAME="t_cm"></A><B>t_cm</B>* *<A NAME="'t_cm'"></A><B>'t_cm'</B>*
<A HREF="#t_Co">t_Co</A> number of colors *<A NAME="t_Co"></A><B>t_Co</B>* *<A NAME="'t_Co'"></A><B>'t_Co'</B>*
<A HREF="#t_CS">t_CS</A> if non-empty, cursor relative to scroll region *<A NAME="t_CS"></A><B>t_CS</B>* *<A NAME="'t_CS'"></A><B>'t_CS'</B>*
<A HREF="#t_cs">t_cs</A> define <A HREF="scroll.html#scrolling">scrolling</A> region *<A NAME="t_cs"></A><B>t_cs</B>* *<A NAME="'t_cs'"></A><B>'t_cs'</B>*
<A HREF="#t_CV">t_CV</A> define vertical <A HREF="scroll.html#scrolling">scrolling</A> region *<A NAME="t_CV"></A><B>t_CV</B>* *<A NAME="'t_CV'"></A><B>'t_CV'</B>*
<A HREF="#t_da">t_da</A> if non-empty, lines from above scroll down *<A NAME="t_da"></A><B>t_da</B>* *<A NAME="'t_da'"></A><B>'t_da'</B>*
<A HREF="#t_db">t_db</A> if non-empty, lines from below scroll up *<A NAME="t_db"></A><B>t_db</B>* *<A NAME="'t_db'"></A><B>'t_db'</B>*
<A HREF="#t_DL">t_DL</A> delete number of lines *<A NAME="t_DL"></A><B>t_DL</B>* *<A NAME="'t_DL'"></A><B>'t_DL'</B>*
<A HREF="#t_dl">t_dl</A> delete line *<A NAME="t_dl"></A><B>t_dl</B>* *<A NAME="'t_dl'"></A><B>'t_dl'</B>*
<A HREF="#t_fs">t_fs</A> set <A HREF="windows.html#window">window</A> title end (from status line) *<A NAME="t_fs"></A><B>t_fs</B>* *<A NAME="'t_fs'"></A><B>'t_fs'</B>*
<A HREF="#t_ke">t_ke</A> exit "keypad transmit" mode *<A NAME="t_ke"></A><B>t_ke</B>* *<A NAME="'t_ke'"></A><B>'t_ke'</B>*
<A HREF="#t_ks">t_ks</A> start "keypad transmit" mode *<A NAME="t_ks"></A><B>t_ks</B>* *<A NAME="'t_ks'"></A><B>'t_ks'</B>*
<A HREF="#t_le">t_le</A> move cursor one char left *<A NAME="t_le"></A><B>t_le</B>* *<A NAME="'t_le'"></A><B>'t_le'</B>*
<A HREF="#t_mb">t_mb</A> blinking mode *<A NAME="t_mb"></A><B>t_mb</B>* *<A NAME="'t_mb'"></A><B>'t_mb'</B>*
<A HREF="#t_md">t_md</A> <A HREF="syntax.html#bold">bold</A> mode *<A NAME="t_md"></A><B>t_md</B>* *<A NAME="'t_md'"></A><B>'t_md'</B>*
<A HREF="#t_me">t_me</A> <A HREF="intro.html#Normal">Normal</A> mode (undoes <A HREF="#t_mr">t_mr</A>, <A HREF="#t_mb">t_mb</A>, <A HREF="#t_md">t_md</A> and color) *<A NAME="t_me"></A><B>t_me</B>* *<A NAME="'t_me'"></A><B>'t_me'</B>*
<A HREF="#t_mr">t_mr</A> reverse (invert) mode *<A NAME="t_mr"></A><B>t_mr</B>* *<A NAME="'t_mr'"></A><B>'t_mr'</B>*
*<A NAME="t_ms"></A><B>t_ms</B>* *<A NAME="'t_ms'"></A><B>'t_ms'</B>*
<A HREF="#t_ms">t_ms</A> if non-empty, cursor can be moved in standout/inverse mode
<A HREF="#t_nd">t_nd</A> non destructive space character *<A NAME="t_nd"></A><B>t_nd</B>* *<A NAME="'t_nd'"></A><B>'t_nd'</B>*
<A HREF="#t_op">t_op</A> reset to original color pair *<A NAME="t_op"></A><B>t_op</B>* *<A NAME="'t_op'"></A><B>'t_op'</B>*
<A HREF="#t_RI">t_RI</A> cursor number of chars right *<A NAME="t_RI"></A><B>t_RI</B>* *<A NAME="'t_RI'"></A><B>'t_RI'</B>*
<A HREF="#t_Sb">t_Sb</A> set background color *<A NAME="t_Sb"></A><B>t_Sb</B>* *<A NAME="'t_Sb'"></A><B>'t_Sb'</B>*
<A HREF="#t_Sf">t_Sf</A> set foreground color *<A NAME="t_Sf"></A><B>t_Sf</B>* *<A NAME="'t_Sf'"></A><B>'t_Sf'</B>*
<A HREF="#t_se">t_se</A> <A HREF="syntax.html#standout">standout</A> end *<A NAME="t_se"></A><B>t_se</B>* *<A NAME="'t_se'"></A><B>'t_se'</B>*
<A HREF="#t_so">t_so</A> <A HREF="syntax.html#standout">standout</A> mode *<A NAME="t_so"></A><B>t_so</B>* *<A NAME="'t_so'"></A><B>'t_so'</B>*
<A HREF="#t_sr">t_sr</A> scroll reverse (backward) *<A NAME="t_sr"></A><B>t_sr</B>* *<A NAME="'t_sr'"></A><B>'t_sr'</B>*
<A HREF="#t_te">t_te</A> out of "<A HREF="#termcap">termcap</A>" mode *<A NAME="t_te"></A><B>t_te</B>* *<A NAME="'t_te'"></A><B>'t_te'</B>*
<A HREF="#t_ti">t_ti</A> put <A HREF="terminal.html#terminal">terminal</A> in "<A HREF="#termcap">termcap</A>" mode *<A NAME="t_ti"></A><B>t_ti</B>* *<A NAME="'t_ti'"></A><B>'t_ti'</B>*
<A HREF="#t_ts">t_ts</A> set <A HREF="windows.html#window">window</A> title start (to status line) *<A NAME="t_ts"></A><B>t_ts</B>* *<A NAME="'t_ts'"></A><B>'t_ts'</B>*
<A HREF="#t_ue">t_ue</A> <A HREF="syntax.html#underline">underline</A> end *<A NAME="t_ue"></A><B>t_ue</B>* *<A NAME="'t_ue'"></A><B>'t_ue'</B>*
<A HREF="#t_us">t_us</A> <A HREF="syntax.html#underline">underline</A> mode *<A NAME="t_us"></A><B>t_us</B>* *<A NAME="'t_us'"></A><B>'t_us'</B>*
<A HREF="#t_ut">t_ut</A> clearing uses the current background color *<A NAME="t_ut"></A><B>t_ut</B>* *<A NAME="'t_ut'"></A><B>'t_ut'</B>*
<A HREF="#t_vb">t_vb</A> visual bell *<A NAME="t_vb"></A><B>t_vb</B>* *<A NAME="'t_vb'"></A><B>'t_vb'</B>*
<A HREF="#t_ve">t_ve</A> cursor visible *<A NAME="t_ve"></A><B>t_ve</B>* *<A NAME="'t_ve'"></A><B>'t_ve'</B>*
<A HREF="#t_vi">t_vi</A> cursor invisible *<A NAME="t_vi"></A><B>t_vi</B>* *<A NAME="'t_vi'"></A><B>'t_vi'</B>*
<A HREF="#t_vs">t_vs</A> cursor very visible (blink) *<A NAME="t_vs"></A><B>t_vs</B>* *<A NAME="'t_vs'"></A><B>'t_vs'</B>*
*<A NAME="t_xs"></A><B>t_xs</B>* *<A NAME="'t_xs'"></A><B>'t_xs'</B>*
<A HREF="#t_xs">t_xs</A> if non-empty, <A HREF="syntax.html#standout">standout</A> not erased by overwriting (hpterm)
*<A NAME="t_xn"></A><B>t_xn</B>* *<A NAME="'t_xn'"></A><B>'t_xn'</B>*
<A HREF="#t_xn">t_xn</A> if non-empty, <A HREF="editing.html#writing">writing</A> a character at the last screen cell
does not cause <A HREF="scroll.html#scrolling">scrolling</A>
<A HREF="#t_ZH">t_ZH</A> italics mode *<A NAME="t_ZH"></A><B>t_ZH</B>* *<A NAME="'t_ZH'"></A><B>'t_ZH'</B>*
<A HREF="#t_ZR">t_ZR</A> italics end *<A NAME="t_ZR"></A><B>t_ZR</B>* *<A NAME="'t_ZR'"></A><B>'t_ZR'</B>*
Added by Vim (there are no standard codes for these):
<A HREF="#t_Ce">t_Ce</A> <A HREF="syntax.html#undercurl">undercurl</A> end *<A NAME="t_Ce"></A><B>t_Ce</B>* *<A NAME="'t_Ce'"></A><B>'t_Ce'</B>*
<A HREF="#t_Cs">t_Cs</A> <A HREF="syntax.html#undercurl">undercurl</A> mode *<A NAME="t_Cs"></A><B>t_Cs</B>* *<A NAME="'t_Cs'"></A><B>'t_Cs'</B>*
<A HREF="#t_Te">t_Te</A> <A HREF="syntax.html#strikethrough">strikethrough</A> end *<A NAME="t_Te"></A><B>t_Te</B>* *<A NAME="'t_Te'"></A><B>'t_Te'</B>*
<A HREF="#t_Ts">t_Ts</A> <A HREF="syntax.html#strikethrough">strikethrough</A> mode *<A NAME="t_Ts"></A><B>t_Ts</B>* *<A NAME="'t_Ts'"></A><B>'t_Ts'</B>*
<A HREF="#t_IS">t_IS</A> set icon text start *<A NAME="t_IS"></A><B>t_IS</B>* *<A NAME="'t_IS'"></A><B>'t_IS'</B>*
<A HREF="#t_IE">t_IE</A> set icon text end *<A NAME="t_IE"></A><B>t_IE</B>* *<A NAME="'t_IE'"></A><B>'t_IE'</B>*
<A HREF="#t_WP">t_WP</A> set <A HREF="windows.html#window">window</A> position (Y, X) in pixels *<A NAME="t_WP"></A><B>t_WP</B>* *<A NAME="'t_WP'"></A><B>'t_WP'</B>*
<A HREF="#t_GP">t_GP</A> get <A HREF="windows.html#window">window</A> position (Y, X) in pixels *<A NAME="t_GP"></A><B>t_GP</B>* *<A NAME="'t_GP'"></A><B>'t_GP'</B>*
<A HREF="#t_WS">t_WS</A> set <A HREF="windows.html#window">window</A> size (height, width in cells) *<A NAME="t_WS"></A><B>t_WS</B>* *<A NAME="'t_WS'"></A><B>'t_WS'</B>*
<A HREF="#t_VS">t_VS</A> cursor normally visible (no blink) *<A NAME="t_VS"></A><B>t_VS</B>* *<A NAME="'t_VS'"></A><B>'t_VS'</B>*
<A HREF="#t_SI">t_SI</A> start insert mode (bar cursor shape) *<A NAME="t_SI"></A><B>t_SI</B>* *<A NAME="'t_SI'"></A><B>'t_SI'</B>*
<A HREF="#t_SR">t_SR</A> start replace mode (underline cursor shape) *<A NAME="t_SR"></A><B>t_SR</B>* *<A NAME="'t_SR'"></A><B>'t_SR'</B>*
<A HREF="#t_EI">t_EI</A> end insert or replace mode (block cursor shape) *<A NAME="t_EI"></A><B>t_EI</B>* *<A NAME="'t_EI'"></A><B>'t_EI'</B>*
|<A HREF="#termcap-cursor-shape">termcap-cursor-shape</A>|
<A HREF="#t_RV">t_RV</A> request <A HREF="terminal.html#terminal">terminal</A> version <A HREF="eval.html#string">string</A> (for xterm) *<A NAME="t_RV"></A><B>t_RV</B>* *<A NAME="'t_RV'"></A><B>'t_RV'</B>*
|<A HREF="#xterm-8bit">xterm-8bit</A>| |<A HREF="eval.html#v:termresponse">v:termresponse</A>| |<A HREF="options.html#'ttymouse'">'ttymouse'</A>| |<A HREF="#xterm-codes">xterm-codes</A>|
<A HREF="#t_u7">t_u7</A> request cursor position (for xterm) *<A NAME="t_u7"></A><B>t_u7</B>* *<A NAME="'t_u7'"></A><B>'t_u7'</B>*
see |<A HREF="options.html#'ambiwidth'">'ambiwidth'</A>|
<A HREF="#t_RF">t_RF</A> request <A HREF="terminal.html#terminal">terminal</A> foreground color *<A NAME="t_RF"></A><B>t_RF</B>* *<A NAME="'t_RF'"></A><B>'t_RF'</B>*
<A HREF="#t_RB">t_RB</A> request <A HREF="terminal.html#terminal">terminal</A> background color *<A NAME="t_RB"></A><B>t_RB</B>* *<A NAME="'t_RB'"></A><B>'t_RB'</B>*
<A HREF="#t_8f">t_8f</A> set foreground color (R, <A HREF="motion.html#G">G</A>, <A HREF="motion.html#B">B</A>) *<A NAME="t_8f"></A><B>t_8f</B>* *<A NAME="'t_8f'"></A><B>'t_8f'</B>*
|<A HREF="#xterm-true-color">xterm-true-color</A>|
<A HREF="#t_8b">t_8b</A> set background color (R, <A HREF="motion.html#G">G</A>, <A HREF="motion.html#B">B</A>) *<A NAME="t_8b"></A><B>t_8b</B>* *<A NAME="'t_8b'"></A><B>'t_8b'</B>*
|<A HREF="#xterm-true-color">xterm-true-color</A>|
<A HREF="#t_BE">t_BE</A> enable bracketed paste mode *<A NAME="t_BE"></A><B>t_BE</B>* *<A NAME="'t_BE'"></A><B>'t_BE'</B>*
|<A HREF="#xterm-bracketed-paste">xterm-bracketed-paste</A>|
<A HREF="#t_BD">t_BD</A> disable bracketed paste mode *<A NAME="t_BD"></A><B>t_BD</B>* *<A NAME="'t_BD'"></A><B>'t_BD'</B>*
|<A HREF="#xterm-bracketed-paste">xterm-bracketed-paste</A>|
<A HREF="#t_SC">t_SC</A> set cursor color start *<A NAME="t_SC"></A><B>t_SC</B>* *<A NAME="'t_SC'"></A><B>'t_SC'</B>*
<A HREF="#t_EC">t_EC</A> set cursor color end *<A NAME="t_EC"></A><B>t_EC</B>* *<A NAME="'t_EC'"></A><B>'t_EC'</B>*
<A HREF="#t_SH">t_SH</A> set cursor shape *<A NAME="t_SH"></A><B>t_SH</B>* *<A NAME="'t_SH'"></A><B>'t_SH'</B>*
<A HREF="#t_RC">t_RC</A> request <A HREF="terminal.html#terminal">terminal</A> cursor blinking *<A NAME="t_RC"></A><B>t_RC</B>* *<A NAME="'t_RC'"></A><B>'t_RC'</B>*
<A HREF="#t_RS">t_RS</A> request <A HREF="terminal.html#terminal">terminal</A> cursor style *<A NAME="t_RS"></A><B>t_RS</B>* *<A NAME="'t_RS'"></A><B>'t_RS'</B>*
Some codes have a start, middle and end part. The start and end are defined
by the <A HREF="#termcap">termcap</A> option, the middle part is text.
set title text: <A HREF="#t_ts">t_ts</A> {title text} <A HREF="#t_fs">t_fs</A>
set icon text: <A HREF="#t_IS">t_IS</A> {icon text} <A HREF="#t_IE">t_IE</A>
set cursor color: <A HREF="#t_SC">t_SC</A> {color name} <A HREF="#t_EC">t_EC</A>
<A HREF="#t_SH">t_SH</A> must take one argument:
0, 1 or none blinking block cursor
2 block cursor
3 blinking <A HREF="syntax.html#underline">underline</A> cursor
4 <A HREF="syntax.html#underline">underline</A> cursor
5 blinking vertical <A HREF="motion.html#bar">bar</A> cursor
6 vertical <A HREF="motion.html#bar">bar</A> cursor
<A HREF="#t_RS">t_RS</A> is sent only if the response to <A HREF="#t_RV">t_RV</A> has been received. It is not used
on <A HREF="os_mac.html#Mac">Mac</A> OS when Terminal.app could be recognized from the termresponse.
KEY CODES *<A NAME="terminal-key-codes"></A><B>terminal-key-codes</B>*
Note: Use the <A HREF="intro.html#<>"><></A> form if possible
<B><FONT COLOR="PURPLE"> option name meaning </FONT></B>
<A HREF="#t_ku">t_ku</A> <A HREF="motion.html#<Up>"><Up></A> arrow up *<A NAME="t_ku"></A><B>t_ku</B>* *<A NAME="'t_ku'"></A><B>'t_ku'</B>*
<A HREF="#t_kd">t_kd</A> <A HREF="motion.html#<Down>"><Down></A> arrow down *<A NAME="t_kd"></A><B>t_kd</B>* *<A NAME="'t_kd'"></A><B>'t_kd'</B>*
<A HREF="#t_kr">t_kr</A> <A HREF="motion.html#<Right>"><Right></A> arrow right *<A NAME="t_kr"></A><B>t_kr</B>* *<A NAME="'t_kr'"></A><B>'t_kr'</B>*
<A HREF="#t_kl">t_kl</A> <A HREF="motion.html#<Left>"><Left></A> arrow left *<A NAME="t_kl"></A><B>t_kl</B>* *<A NAME="'t_kl'"></A><B>'t_kl'</B>*
<A HREF="#<xUp>"><xUp></A> alternate arrow up *<A NAME="<xUp>"></A><B><xUp></B>*
<A HREF="#<xDown>"><xDown></A> alternate arrow down *<A NAME="<xDown>"></A><B><xDown></B>*
<A HREF="#<xRight>"><xRight></A> alternate arrow right *<A NAME="<xRight>"></A><B><xRight></B>*
<A HREF="#<xLeft>"><xLeft></A> alternate arrow left *<A NAME="<xLeft>"></A><B><xLeft></B>*
<A HREF="scroll.html#<S-Up>"><S-Up></A> <A HREF="intro.html#shift">shift</A> arrow up
<A HREF="scroll.html#<S-Down>"><S-Down></A> <A HREF="intro.html#shift">shift</A> arrow down
<A HREF="#t_%i">t_%i</A> <A HREF="motion.html#<S-Right>"><S-Right></A> <A HREF="intro.html#shift">shift</A> arrow right *<A NAME="t_%i"></A><B>t_%i</B>* *<A NAME="'t_%i'"></A><B>'t_%i'</B>*
<A HREF="#t_#4">t_#4</A> <A HREF="motion.html#<S-Left>"><S-Left></A> <A HREF="intro.html#shift">shift</A> arrow left *<A NAME="t_#4"></A><B>t_#4</B>* *<A NAME="'t_#4'"></A><B>'t_#4'</B>*
<A HREF="#t_k1">t_k1</A> <A HREF="helphelp.html#<F1>"><F1></A> function key 1 *<A NAME="t_k1"></A><B>t_k1</B>* *<A NAME="'t_k1'"></A><B>'t_k1'</B>*
<A HREF="#<xF1>"><xF1></A> alternate F1 *<A NAME="<xF1>"></A><B><xF1></B>*
<A HREF="#t_k2">t_k2</A> <A HREF="#<F2>"><F2></A> function key 2 *<A NAME="<F2>"></A><B><F2></B>* *<A NAME="t_k2"></A><B>t_k2</B>* *<A NAME="'t_k2'"></A><B>'t_k2'</B>*
<A HREF="#<xF2>"><xF2></A> alternate F2 *<A NAME="<xF2>"></A><B><xF2></B>*
<A HREF="#t_k3">t_k3</A> <A HREF="#<F3>"><F3></A> function key 3 *<A NAME="<F3>"></A><B><F3></B>* *<A NAME="t_k3"></A><B>t_k3</B>* *<A NAME="'t_k3'"></A><B>'t_k3'</B>*
<A HREF="#<xF3>"><xF3></A> alternate F3 *<A NAME="<xF3>"></A><B><xF3></B>*
<A HREF="#t_k4">t_k4</A> <A HREF="#<F4>"><F4></A> function key 4 *<A NAME="<F4>"></A><B><F4></B>* *<A NAME="t_k4"></A><B>t_k4</B>* *<A NAME="'t_k4'"></A><B>'t_k4'</B>*
<A HREF="#<xF4>"><xF4></A> alternate F4 *<A NAME="<xF4>"></A><B><xF4></B>*
<A HREF="#t_k5">t_k5</A> <A HREF="#<F5>"><F5></A> function key 5 *<A NAME="<F5>"></A><B><F5></B>* *<A NAME="t_k5"></A><B>t_k5</B>* *<A NAME="'t_k5'"></A><B>'t_k5'</B>*
<A HREF="#t_k6">t_k6</A> <A HREF="#<F6>"><F6></A> function key 6 *<A NAME="<F6>"></A><B><F6></B>* *<A NAME="t_k6"></A><B>t_k6</B>* *<A NAME="'t_k6'"></A><B>'t_k6'</B>*
<A HREF="#t_k7">t_k7</A> <A HREF="#<F7>"><F7></A> function key 7 *<A NAME="<F7>"></A><B><F7></B>* *<A NAME="t_k7"></A><B>t_k7</B>* *<A NAME="'t_k7'"></A><B>'t_k7'</B>*
<A HREF="#t_k8">t_k8</A> <A HREF="#<F8>"><F8></A> function key 8 *<A NAME="<F8>"></A><B><F8></B>* *<A NAME="t_k8"></A><B>t_k8</B>* *<A NAME="'t_k8'"></A><B>'t_k8'</B>*
<A HREF="#t_k9">t_k9</A> <A HREF="#<F9>"><F9></A> function key 9 *<A NAME="<F9>"></A><B><F9></B>* *<A NAME="t_k9"></A><B>t_k9</B>* *<A NAME="'t_k9'"></A><B>'t_k9'</B>*
<A HREF="#t_k;">t_k;</A> <A HREF="#<F10>"><F10></A> function key 10 *<A NAME="<F10>"></A><B><F10></B>* *<A NAME="t_k;"></A><B>t_k;</B>* *<A NAME="'t_k;'"></A><B>'t_k;'</B>*
<A HREF="#t_F1">t_F1</A> <A HREF="#<F11>"><F11></A> function key 11 *<A NAME="<F11>"></A><B><F11></B>* *<A NAME="t_F1"></A><B>t_F1</B>* *<A NAME="'t_F1'"></A><B>'t_F1'</B>*
<A HREF="#t_F2">t_F2</A> <A HREF="#<F12>"><F12></A> function key 12 *<A NAME="<F12>"></A><B><F12></B>* *<A NAME="t_F2"></A><B>t_F2</B>* *<A NAME="'t_F2'"></A><B>'t_F2'</B>*
<A HREF="#t_F3">t_F3</A> <A HREF="#<F13>"><F13></A> function key 13 *<A NAME="<F13>"></A><B><F13></B>* *<A NAME="t_F3"></A><B>t_F3</B>* *<A NAME="'t_F3'"></A><B>'t_F3'</B>*
<A HREF="#t_F4">t_F4</A> <A HREF="#<F14>"><F14></A> function key 14 *<A NAME="<F14>"></A><B><F14></B>* *<A NAME="t_F4"></A><B>t_F4</B>* *<A NAME="'t_F4'"></A><B>'t_F4'</B>*
<A HREF="#t_F5">t_F5</A> <A HREF="#<F15>"><F15></A> function key 15 *<A NAME="<F15>"></A><B><F15></B>* *<A NAME="t_F5"></A><B>t_F5</B>* *<A NAME="'t_F5'"></A><B>'t_F5'</B>*
<A HREF="#t_F6">t_F6</A> <A HREF="#<F16>"><F16></A> function key 16 *<A NAME="<F16>"></A><B><F16></B>* *<A NAME="t_F6"></A><B>t_F6</B>* *<A NAME="'t_F6'"></A><B>'t_F6'</B>*
<A HREF="#t_F7">t_F7</A> <A HREF="#<F17>"><F17></A> function key 17 *<A NAME="<F17>"></A><B><F17></B>* *<A NAME="t_F7"></A><B>t_F7</B>* *<A NAME="'t_F7'"></A><B>'t_F7'</B>*
<A HREF="#t_F8">t_F8</A> <A HREF="#<F18>"><F18></A> function key 18 *<A NAME="<F18>"></A><B><F18></B>* *<A NAME="t_F8"></A><B>t_F8</B>* *<A NAME="'t_F8'"></A><B>'t_F8'</B>*
<A HREF="#t_F9">t_F9</A> <A HREF="#<F19>"><F19></A> function key 19 *<A NAME="<F19>"></A><B><F19></B>* *<A NAME="t_F9"></A><B>t_F9</B>* *<A NAME="'t_F9'"></A><B>'t_F9'</B>*
<A HREF="intro.html#<S-F1>"><S-F1></A> shifted function key 1
<A HREF="#<S-xF1>"><S-xF1></A> alternate <A HREF="intro.html#<S-F1>"><S-F1></A> *<A NAME="<S-xF1>"></A><B><S-xF1></B>*
<A HREF="#<S-F2>"><S-F2></A> shifted function key 2 *<A NAME="<S-F2>"></A><B><S-F2></B>*
<A HREF="#<S-xF2>"><S-xF2></A> alternate <A HREF="#<S-F2>"><S-F2></A> *<A NAME="<S-xF2>"></A><B><S-xF2></B>*
<A HREF="#<S-F3>"><S-F3></A> shifted function key 3 *<A NAME="<S-F3>"></A><B><S-F3></B>*
<A HREF="#<S-xF3>"><S-xF3></A> alternate <A HREF="#<S-F3>"><S-F3></A> *<A NAME="<S-xF3>"></A><B><S-xF3></B>*
<A HREF="#<S-F4>"><S-F4></A> shifted function key 4 *<A NAME="<S-F4>"></A><B><S-F4></B>*
<A HREF="#<S-xF4>"><S-xF4></A> alternate <A HREF="#<S-F4>"><S-F4></A> *<A NAME="<S-xF4>"></A><B><S-xF4></B>*
<A HREF="#<S-F5>"><S-F5></A> shifted function key 5 *<A NAME="<S-F5>"></A><B><S-F5></B>*
<A HREF="#<S-F6>"><S-F6></A> shifted function key 6 *<A NAME="<S-F6>"></A><B><S-F6></B>*
<A HREF="#<S-F7>"><S-F7></A> shifted function key 7 *<A NAME="<S-F7>"></A><B><S-F7></B>*
<A HREF="#<S-F8>"><S-F8></A> shifted function key 8 *<A NAME="<S-F8>"></A><B><S-F8></B>*
<A HREF="#<S-F9>"><S-F9></A> shifted function key 9 *<A NAME="<S-F9>"></A><B><S-F9></B>*
<A HREF="#<S-F10>"><S-F10></A> shifted function key 10 *<A NAME="<S-F10>"></A><B><S-F10></B>*
<A HREF="#<S-F11>"><S-F11></A> shifted function key 11 *<A NAME="<S-F11>"></A><B><S-F11></B>*
<A HREF="#<S-F12>"><S-F12></A> shifted function key 12 *<A NAME="<S-F12>"></A><B><S-F12></B>*
<A HREF="#t_%1">t_%1</A> <A HREF="helphelp.html#<Help>"><Help></A> help key *<A NAME="t_%1"></A><B>t_%1</B>* *<A NAME="'t_%1'"></A><B>'t_%1'</B>*
<A HREF="#t_&8">t_&8</A> <A HREF="undo.html#<Undo>"><Undo></A> <A HREF="undo.html#undo">undo</A> key *<A NAME="t_&8"></A><B>t_&8</B>* *<A NAME="'t_&8'"></A><B>'t_&8'</B>*
<A HREF="#t_kI">t_kI</A> <A HREF="insert.html#<Insert>"><Insert></A> insert key *<A NAME="t_kI"></A><B>t_kI</B>* *<A NAME="'t_kI'"></A><B>'t_kI'</B>*
<A HREF="#t_kD">t_kD</A> <A HREF="change.html#<Del>"><Del></A> delete key *<A NAME="t_kD"></A><B>t_kD</B>* *<A NAME="'t_kD'"></A><B>'t_kD'</B>*
<A HREF="#t_kb">t_kb</A> <A HREF="motion.html#<BS>"><BS></A> backspace key *<A NAME="t_kb"></A><B>t_kb</B>* *<A NAME="'t_kb'"></A><B>'t_kb'</B>*
<A HREF="#t_kB">t_kB</A> <A HREF="#<S-Tab>"><S-Tab></A> back-tab (shift-tab) *<A NAME="<S-Tab>"></A><B><S-Tab></B>* *<A NAME="t_kB"></A><B>t_kB</B>* *<A NAME="'t_kB'"></A><B>'t_kB'</B>*
<A HREF="#t_kh">t_kh</A> <A HREF="motion.html#<Home>"><Home></A> home key *<A NAME="t_kh"></A><B>t_kh</B>* *<A NAME="'t_kh'"></A><B>'t_kh'</B>*
<A HREF="#t_#2">t_#2</A> <A HREF="#<S-Home>"><S-Home></A> shifted home key *<A NAME="<S-Home>"></A><B><S-Home></B>* *<A NAME="t_#2"></A><B>t_#2</B>* *<A NAME="'t_#2'"></A><B>'t_#2'</B>*
<A HREF="#<xHome>"><xHome></A> alternate home key *<A NAME="<xHome>"></A><B><xHome></B>*
<A HREF="#t_@7">t_@7</A> <A HREF="motion.html#<End>"><End></A> end key *<A NAME="t_@7"></A><B>t_@7</B>* *<A NAME="'t_@7'"></A><B>'t_@7'</B>*
t_*7 <A HREF="#<S-End>"><S-End></A> shifted end key *<S-End>* *t_star7* *'t_star7'*
<A HREF="#<xEnd>"><xEnd></A> alternate end key *<A NAME="<xEnd>"></A><B><xEnd></B>*
<A HREF="#t_kP">t_kP</A> <A HREF="scroll.html#<PageUp>"><PageUp></A> <A HREF="intro.html#page-up">page-up</A> key *<A NAME="t_kP"></A><B>t_kP</B>* *<A NAME="'t_kP'"></A><B>'t_kP'</B>*
<A HREF="#t_kN">t_kN</A> <A HREF="scroll.html#<PageDown>"><PageDown></A> <A HREF="intro.html#page-down">page-down</A> key *<A NAME="t_kN"></A><B>t_kN</B>* *<A NAME="'t_kN'"></A><B>'t_kN'</B>*
<A HREF="#t_K1">t_K1</A> <A HREF="motion.html#<kHome>"><kHome></A> keypad home key *<A NAME="t_K1"></A><B>t_K1</B>* *<A NAME="'t_K1'"></A><B>'t_K1'</B>*
<A HREF="#t_K4">t_K4</A> <A HREF="motion.html#<kEnd>"><kEnd></A> keypad end key *<A NAME="t_K4"></A><B>t_K4</B>* *<A NAME="'t_K4'"></A><B>'t_K4'</B>*
<A HREF="#t_K3">t_K3</A> <A HREF="scroll.html#<kPageUp>"><kPageUp></A> keypad <A HREF="intro.html#page-up">page-up</A> key *<A NAME="t_K3"></A><B>t_K3</B>* *<A NAME="'t_K3'"></A><B>'t_K3'</B>*
<A HREF="#t_K5">t_K5</A> <A HREF="scroll.html#<kPageDown>"><kPageDown></A> keypad <A HREF="intro.html#page-down">page-down</A> key *<A NAME="t_K5"></A><B>t_K5</B>* *<A NAME="'t_K5'"></A><B>'t_K5'</B>*
<A HREF="#t_K6">t_K6</A> <A HREF="#<kPlus>"><kPlus></A> keypad plus key *<A NAME="<kPlus>"></A><B><kPlus></B>* *<A NAME="t_K6"></A><B>t_K6</B>* *<A NAME="'t_K6'"></A><B>'t_K6'</B>*
<A HREF="#t_K7">t_K7</A> <A HREF="#<kMinus>"><kMinus></A> keypad minus key *<A NAME="<kMinus>"></A><B><kMinus></B>* *<A NAME="t_K7"></A><B>t_K7</B>* *<A NAME="'t_K7'"></A><B>'t_K7'</B>*
<A HREF="#t_K8">t_K8</A> <A HREF="#<kDivide>"><kDivide></A> keypad divide *<A NAME="<kDivide>"></A><B><kDivide></B>* *<A NAME="t_K8"></A><B>t_K8</B>* *<A NAME="'t_K8'"></A><B>'t_K8'</B>*
<A HREF="#t_K9">t_K9</A> <A HREF="#<kMultiply>"><kMultiply></A> keypad multiply *<A NAME="<kMultiply>"></A><B><kMultiply></B>* *<A NAME="t_K9"></A><B>t_K9</B>* *<A NAME="'t_K9'"></A><B>'t_K9'</B>*
<A HREF="#t_KA">t_KA</A> <A HREF="#<kEnter>"><kEnter></A> keypad enter key *<A NAME="<kEnter>"></A><B><kEnter></B>* *<A NAME="t_KA"></A><B>t_KA</B>* *<A NAME="'t_KA'"></A><B>'t_KA'</B>*
<A HREF="#t_KB">t_KB</A> <A HREF="#<kPoint>"><kPoint></A> keypad decimal point *<A NAME="<kPoint>"></A><B><kPoint></B>* *<A NAME="t_KB"></A><B>t_KB</B>* *<A NAME="'t_KB'"></A><B>'t_KB'</B>*
<A HREF="#t_KC">t_KC</A> <A HREF="#<k0>"><k0></A> keypad 0 *<A NAME="<k0>"></A><B><k0></B>* *<A NAME="t_KC"></A><B>t_KC</B>* *<A NAME="'t_KC'"></A><B>'t_KC'</B>*
<A HREF="#t_KD">t_KD</A> <A HREF="#<k1>"><k1></A> keypad 1 *<A NAME="<k1>"></A><B><k1></B>* *<A NAME="t_KD"></A><B>t_KD</B>* *<A NAME="'t_KD'"></A><B>'t_KD'</B>*
<A HREF="#t_KE">t_KE</A> <A HREF="#<k2>"><k2></A> keypad 2 *<A NAME="<k2>"></A><B><k2></B>* *<A NAME="t_KE"></A><B>t_KE</B>* *<A NAME="'t_KE'"></A><B>'t_KE'</B>*
<A HREF="#t_KF">t_KF</A> <A HREF="#<k3>"><k3></A> keypad 3 *<A NAME="<k3>"></A><B><k3></B>* *<A NAME="t_KF"></A><B>t_KF</B>* *<A NAME="'t_KF'"></A><B>'t_KF'</B>*
<A HREF="#t_KG">t_KG</A> <A HREF="#<k4>"><k4></A> keypad 4 *<A NAME="<k4>"></A><B><k4></B>* *<A NAME="t_KG"></A><B>t_KG</B>* *<A NAME="'t_KG'"></A><B>'t_KG'</B>*
<A HREF="#t_KH">t_KH</A> <A HREF="#<k5>"><k5></A> keypad 5 *<A NAME="<k5>"></A><B><k5></B>* *<A NAME="t_KH"></A><B>t_KH</B>* *<A NAME="'t_KH'"></A><B>'t_KH'</B>*
<A HREF="#t_KI">t_KI</A> <A HREF="#<k6>"><k6></A> keypad 6 *<A NAME="<k6>"></A><B><k6></B>* *<A NAME="t_KI"></A><B>t_KI</B>* *<A NAME="'t_KI'"></A><B>'t_KI'</B>*
<A HREF="#t_KJ">t_KJ</A> <A HREF="#<k7>"><k7></A> keypad 7 *<A NAME="<k7>"></A><B><k7></B>* *<A NAME="t_KJ"></A><B>t_KJ</B>* *<A NAME="'t_KJ'"></A><B>'t_KJ'</B>*
<A HREF="#t_KK">t_KK</A> <A HREF="#<k8>"><k8></A> keypad 8 *<A NAME="<k8>"></A><B><k8></B>* *<A NAME="t_KK"></A><B>t_KK</B>* *<A NAME="'t_KK'"></A><B>'t_KK'</B>*
<A HREF="#t_KL">t_KL</A> <A HREF="#<k9>"><k9></A> keypad 9 *<A NAME="<k9>"></A><B><k9></B>* *<A NAME="t_KL"></A><B>t_KL</B>* *<A NAME="'t_KL'"></A><B>'t_KL'</B>*
<A HREF="#<Mouse>"><Mouse></A> leader of mouse code *<A NAME="<Mouse>"></A><B><Mouse></B>*
*<A NAME="t_PS"></A><B>t_PS</B>* *<A NAME="'t_PS'"></A><B>'t_PS'</B>*
<A HREF="#t_PS">t_PS</A> start of bracketed paste |<A HREF="#xterm-bracketed-paste">xterm-bracketed-paste</A>|
<A HREF="#t_PE">t_PE</A> end of bracketed paste |<A HREF="#xterm-bracketed-paste">xterm-bracketed-paste</A>| *<A NAME="t_PE"></A><B>t_PE</B>* *<A NAME="'t_PE'"></A><B>'t_PE'</B>*
Note about <A HREF="#t_so">t_so</A> and <A HREF="#t_mr">t_mr</A>: When the <A HREF="#termcap">termcap</A> entry "so" is not present the
entry for "mr" is used. And vice versa. The same is done for "se" and "me".
If your <A HREF="terminal.html#terminal">terminal</A> supports both inversion and <A HREF="syntax.html#standout">standout</A> mode, you can see two
different modes. If your <A HREF="terminal.html#terminal">terminal</A> supports only one of the modes, both will
look the same.
*<A NAME="keypad-comma"></A><B>keypad-comma</B>*
The keypad keys, when they are not mapped, behave like the equivalent normal
key. There is one exception: if you have a comma on the keypad instead of a
decimal point, Vim will use a dot anyway. Use these mappings to fix that:
<B> :noremap <kPoint> ,</B>
<B> :noremap! <kPoint> ,</B>
*<A NAME="xterm-codes"></A><B>xterm-codes</B>*
There is a special trick to obtain the key codes which currently only works
for xterm. When |<A HREF="#t_RV">t_RV</A>| is defined and a response is received which indicates
an xterm with patchlevel 141 or higher, Vim uses special <A HREF="intro.html#escape">escape</A> sequences to
request the key codes directly from the xterm. The responses are used to
adjust the various t_ codes. This avoids the problem that the xterm can
produce different codes, depending on the mode <A HREF="motion.html#it">it</A> is in (8-bit, VT102,
VT220, etc.). The result is that codes like <A HREF="#<xF1>"><xF1></A> are no longer needed.
Note: This is only done on <A HREF="starting.html#startup">startup</A>. If the xterm <A HREF="options.html#options">options</A> are changed after
Vim has started, the <A HREF="intro.html#escape">escape</A> sequences may not be recognized anymore.
*<A NAME="xterm-true-color"></A><B>xterm-true-color</B>*
Vim supports using true colors in the <A HREF="terminal.html#terminal">terminal</A> (taken from |<A HREF="syntax.html#highlight-guifg">highlight-guifg</A>|
and |<A HREF="syntax.html#highlight-guibg">highlight-guibg</A>|), given that the <A HREF="terminal.html#terminal">terminal</A> supports this. To make this
work the <A HREF="options.html#'termguicolors'">'termguicolors'</A> option needs to be set.
See https://gist.github.com/XVilka/8346728 for a <A HREF="eval.html#list">list</A> of terminals that
support true colors.
Sometimes setting <A HREF="options.html#'termguicolors'">'termguicolors'</A> is not enough and one has to set the |<A HREF="#t_8f">t_8f</A>|
and |<A HREF="#t_8b">t_8b</A>| <A HREF="options.html#options">options</A> explicitly. Default values of these <A HREF="options.html#options">options</A> are
"^[[38;2;%lu;%lu;%lum" and "^[[48;2;%lu;%lu;%lum" respectively, but <A HREF="motion.html#it">it</A> is only
set when `$TERM` is `xterm`. Some terminals accept the same sequences, but
with all semicolons replaced by colons (this is actually more compatible, but
<A HREF="various.html#less">less</A> widely supported):
<B> let &t_8f = "\<Esc>[38:2:%lu:%lu:%lum"</B>
<B> let &t_8b = "\<Esc>[48:2:%lu:%lu:%lum"</B>
These <A HREF="options.html#options">options</A> contain printf strings, with |<A HREF="eval.html#printf()">printf()</A>| (actually, its C
equivalent hence `l` modifier) invoked with the t_ option value and three
unsigned long integers that may have any value between 0 and 255 (inclusive)
representing red, green and blue colors respectively.
*<A NAME="xterm-resize"></A><B>xterm-resize</B>*
Window resizing with xterm only works if the allowWindowOps resource is
enabled. On some systems and versions of xterm it's disabled by default
because someone thought <A HREF="motion.html#it">it</A> would be a security issue. It's not clear if this
is actually the <A HREF="change.html#case">case</A>.
To overrule the default, put this line in your ~/.Xdefaults or
~/.Xresources:
<B> XTerm*allowWindowOps: true</B>
And run "xrdb -merge .Xresources" to make <A HREF="motion.html#it">it</A> effective. You can check the
value with the context menu (right mouse button while CTRL key is pressed),
there should be a tick at allow-window-ops.
*<A NAME="termcap-colors"></A><B>termcap-colors</B>*
Note about colors: The <A HREF="#'t_Co'">'t_Co'</A> option tells Vim the number of colors available.
When <A HREF="motion.html#it">it</A> is non-zero, the <A HREF="#'t_AB'">'t_AB'</A> and <A HREF="#'t_AF'">'t_AF'</A> <A HREF="options.html#options">options</A> are used to set the color.
If one of these is not available, <A HREF="#'t_Sb'">'t_Sb'</A> and <A HREF="#'t_Sf'">'t_Sf'</A> are used. <A HREF="#'t_me'">'t_me'</A> is used
to reset to the default colors.
*<A NAME="termcap-cursor-shape"></A><B>termcap-cursor-shape</B>* *<A NAME="termcap-cursor-color"></A><B>termcap-cursor-color</B>*
When Vim enters <A HREF="insert.html#Insert">Insert</A> mode the <A HREF="#'t_SI'">'t_SI'</A> <A HREF="intro.html#escape">escape</A> sequence is sent. When Vim
enters <A HREF="insert.html#Replace">Replace</A> mode the <A HREF="#'t_SR'">'t_SR'</A> <A HREF="intro.html#escape">escape</A> sequence is sent if <A HREF="motion.html#it">it</A> is set, otherwise
<A HREF="#'t_SI'">'t_SI'</A> is sent. When leaving <A HREF="insert.html#Insert">Insert</A> mode or <A HREF="insert.html#Replace">Replace</A> mode <A HREF="#'t_EI'">'t_EI'</A> is used. This
can be used to change the shape or color of the cursor in <A HREF="insert.html#Insert">Insert</A> or <A HREF="insert.html#Replace">Replace</A>
mode. These are not standard termcap/terminfo entries, you need to set them
yourself.
Example for an xterm, this changes the color of the cursor:
<B> if &term =~ "xterm"</B>
<B> let &t_SI = "\<Esc>]12;purple\x7"</B>
<B> let &t_SR = "\<Esc>]12;red\x7"</B>
<B> let &t_EI = "\<Esc>]12;blue\x7"</B>
<B> endif</B>
NOTE: When Vim exits the shape for <A HREF="intro.html#Normal">Normal</A> mode will remain. The shape from
before Vim started will not be restored.
{not available when compiled without the |<A HREF="various.html#+cursorshape">+cursorshape</A>| feature}
*<A NAME="termcap-title"></A><B>termcap-title</B>*
The <A HREF="#'t_ts'">'t_ts'</A> and <A HREF="#'t_fs'">'t_fs'</A> <A HREF="options.html#options">options</A> are used to set the <A HREF="windows.html#window">window</A> title if the <A HREF="terminal.html#terminal">terminal</A>
allows title setting via sending strings. They are sent before and after the
title <A HREF="eval.html#string">string</A>, respectively. Similar <A HREF="#'t_IS'">'t_IS'</A> and <A HREF="#'t_IE'">'t_IE'</A> are used to set the
icon text. These are Vim-internal extensions of the <A HREF="os_unix.html#Unix">Unix</A> <A HREF="#termcap">termcap</A>, so they
cannot be obtained from an external <A HREF="#termcap">termcap</A>. However, the builtin <A HREF="#termcap">termcap</A>
contains suitable entries for xterm and iris-ansi, so you don't need to set
them here.
*<A NAME="hpterm"></A><B>hpterm</B>*
If inversion or other highlighting does not work correctly, try setting the
<A HREF="#'t_xs'">'t_xs'</A> option to a non-empty <A HREF="eval.html#string">string</A>. This makes the <A HREF="#'t_ce'">'t_ce'</A> code be used to
remove highlighting from a line. This is required for "<A HREF="#hpterm">hpterm</A>". Setting the
<A HREF="options.html#'weirdinvert'">'weirdinvert'</A> option has the same effect <A HREF="motion.html#as">as</A> making <A HREF="#'t_xs'">'t_xs'</A> non-empty, and vice
versa.
*<A NAME="scroll-region"></A><B>scroll-region</B>*
Some termcaps <A HREF="diff.html#do">do</A> not include an entry for 'cs' (scroll region), although the
<A HREF="terminal.html#terminal">terminal</A> does support <A HREF="motion.html#it">it</A>. For example: xterm on a Sun. You can use the
builtin_xterm or define <A HREF="#t_cs">t_cs</A> yourself. For example:
<B> :set t_cs=^V^[[%i%d;%dr</B>
Where ^V is <A HREF="visual.html#CTRL-V">CTRL-V</A> and ^[ is <A HREF="intro.html#<Esc>"><Esc></A>.
The vertical scroll region <A HREF="#t_CV">t_CV</A> is not a standard <A HREF="#termcap">termcap</A> code. Vim uses <A HREF="motion.html#it">it</A>
internally in the <A HREF="gui.html#GUI">GUI</A>. But <A HREF="motion.html#it">it</A> can also be defined for a <A HREF="terminal.html#terminal">terminal</A>, if you can
find one that supports <A HREF="motion.html#it">it</A>. The two arguments are the left and right column of
the region which to restrict the <A HREF="scroll.html#scrolling">scrolling</A> to. Just like <A HREF="#t_cs">t_cs</A> defines the top
and bottom lines. Defining <A HREF="#t_CV">t_CV</A> will make <A HREF="scroll.html#scrolling">scrolling</A> in vertically split
<A HREF="windows.html#windows">windows</A> a lot faster. Don't set <A HREF="#t_CV">t_CV</A> when <A HREF="#t_da">t_da</A> or <A HREF="#t_db">t_db</A> is set (text isn't
cleared when <A HREF="scroll.html#scrolling">scrolling</A>).
Unfortunately <A HREF="motion.html#it">it</A> is not possible to deduce from the <A HREF="#termcap">termcap</A> how cursor
positioning should be done when using a <A HREF="scroll.html#scrolling">scrolling</A> region: Relative to the
beginning of the screen or relative to the beginning of the <A HREF="scroll.html#scrolling">scrolling</A> region.
Most terminals use the first method. A known exception is the <A HREF="os_msdos.html#MS-DOS">MS-DOS</A> console
(pcterm). The <A HREF="#'t_CS'">'t_CS'</A> option should be set to any <A HREF="eval.html#string">string</A> when cursor
positioning is relative to the start of the <A HREF="scroll.html#scrolling">scrolling</A> region. It should be
set to an empty <A HREF="eval.html#string">string</A> otherwise. It defaults to "yes" when <A HREF="options.html#'term'">'term'</A> is
"pcterm".
Note for xterm users: The shifted cursor keys normally don't work. You can
make them work with the xmodmap command and some mappings in Vim.
Give these commands in the xterm:
xmodmap <A HREF="starting.html#-e">-e</A> "keysym Up = Up F13"
xmodmap <A HREF="starting.html#-e">-e</A> "keysym Down = Down F16"
xmodmap <A HREF="starting.html#-e">-e</A> "keysym Left = Left F18"
xmodmap <A HREF="starting.html#-e">-e</A> "keysym Right = Right F19"
And use these mappings in Vim:
<A HREF="map.html#:map">:map</A> <t_F3> <A HREF="scroll.html#<S-Up>"><S-Up></A>
<A HREF="map.html#:map!">:map!</A> <t_F3> <A HREF="scroll.html#<S-Up>"><S-Up></A>
<A HREF="map.html#:map">:map</A> <t_F6> <A HREF="scroll.html#<S-Down>"><S-Down></A>
<A HREF="map.html#:map!">:map!</A> <t_F6> <A HREF="scroll.html#<S-Down>"><S-Down></A>
<A HREF="map.html#:map">:map</A> <t_F8> <A HREF="motion.html#<S-Left>"><S-Left></A>
<A HREF="map.html#:map!">:map!</A> <t_F8> <A HREF="motion.html#<S-Left>"><S-Left></A>
<A HREF="map.html#:map">:map</A> <t_F9> <A HREF="motion.html#<S-Right>"><S-Right></A>
<A HREF="map.html#:map!">:map!</A> <t_F9> <A HREF="motion.html#<S-Right>"><S-Right></A>
Instead of, say, <A HREF="scroll.html#<S-Up>"><S-Up></A> you can use any other command that you want to use the
shift-cursor-up key for. (Note: To help people that have a Sun keyboard with
left side keys F14 is not used because <A HREF="motion.html#it">it</A> is confused with the <A HREF="undo.html#undo">undo</A> key; F15
is not used, because <A HREF="motion.html#it">it</A> does a window-to-front; F17 is not used, because <A HREF="motion.html#it">it</A>
closes the <A HREF="windows.html#window">window</A>. On other systems you can probably use them.)
==============================================================================
3. Window size *<A NAME="window-size"></A><B>window-size</B>*
[This is about the size of the whole <A HREF="windows.html#window">window</A> Vim is using, not a <A HREF="windows.html#window">window</A> that is
created with the "<A HREF="windows.html#:split">:split</A>" command.]
If you are running Vim on an <A HREF="os_amiga.html#Amiga">Amiga</A> and the <A HREF="terminal.html#terminal">terminal</A> name is "amiga" or
"builtin_amiga", the amiga-specific <A HREF="windows.html#window">window</A> resizing will be enabled. On <A HREF="os_unix.html#Unix">Unix</A>
systems three methods are tried to get the <A HREF="windows.html#window">window</A> size:
- an ioctl call (TIOCGSIZE or TIOCGWINSZ, depends on your system)
- the environment <A HREF="eval.html#variables">variables</A> "LINES" and "COLUMNS"
- from the <A HREF="#termcap">termcap</A> entries "li" and "co"
If everything fails a default size of 24 lines and 80 columns is assumed. If
a <A HREF="windows.html#window-resize">window-resize</A> signal is received the size will be set again. If the <A HREF="windows.html#window">window</A>
size is wrong you can use the <A HREF="options.html#'lines'">'lines'</A> and <A HREF="options.html#'columns'">'columns'</A> <A HREF="options.html#options">options</A> to set the
correct values.
One command can be used to set the screen size:
*<A NAME=":mod"></A><B>:mod</B>* *<A NAME=":mode"></A><B>:mode</B>* *<A NAME="E359"></A><B>E359</B>*
:mod[e] [mode]
Without argument this only detects the screen size and redraws the screen.
With <A HREF="os_msdos.html#MS-DOS">MS-DOS</A> <A HREF="motion.html#it">it</A> is possible to switch screen mode. [mode] can be one of these
values:
"bw40" 40 columns black&white
"c40" 40 columns color
"bw80" 80 columns black&white
"c80" 80 columns color (most people use this)
"mono" 80 columns monochrome
"c4350" 43 or 50 lines EGA/VGA mode
number mode number to use, depends on your video card
==============================================================================
4. Slow and fast terminals *<A NAME="slow-fast-terminal"></A><B>slow-fast-terminal</B>*
*<A NAME="slow-terminal"></A><B>slow-terminal</B>*
If you have a fast <A HREF="terminal.html#terminal">terminal</A> you may like to set the <A HREF="options.html#'ruler'">'ruler'</A> option. The
cursor position is shown in the status line. If you are using horizontal
<A HREF="scroll.html#scrolling">scrolling</A> ('wrap' option off) consider setting <A HREF="options.html#'sidescroll'">'sidescroll'</A> to a small
number.
If you have a slow <A HREF="terminal.html#terminal">terminal</A> you may want to reset the <A HREF="options.html#'showcmd'">'showcmd'</A> option.
The command characters will not be shown in the status line. If the <A HREF="terminal.html#terminal">terminal</A>
scrolls very slowly, set the <A HREF="options.html#'scrolljump'">'scrolljump'</A> to 5 or so. If the cursor is moved
off the screen (e.g., with "<A HREF="motion.html#j">j</A>") 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 <A HREF="terminal.html#terminal">terminal</A> are arriving with more than 1 second
between them you might want to set the <A HREF="options.html#'timeout'">'timeout'</A> and/or <A HREF="options.html#'ttimeout'">'ttimeout'</A> option.
See the "Options" chapter |<A HREF="options.html#options">options</A>|.
If your <A HREF="terminal.html#terminal">terminal</A> does not support a <A HREF="scroll.html#scrolling">scrolling</A> region, but <A HREF="motion.html#it">it</A> does support
insert/delete line commands, <A HREF="scroll.html#scrolling">scrolling</A> with multiple <A HREF="windows.html#windows">windows</A> may make the
lines jump up and down. If you don't want this set the <A HREF="options.html#'ttyfast'">'ttyfast'</A> option.
This will redraw the <A HREF="windows.html#window">window</A> instead of scroll <A HREF="motion.html#it">it</A>.
If your <A HREF="terminal.html#terminal">terminal</A> scrolls very slowly, but redrawing is not slow, set the
<A HREF="options.html#'ttyscroll'">'ttyscroll'</A> option to a small number, e.g., 3. This will make Vim redraw the
screen instead of <A HREF="scroll.html#scrolling">scrolling</A>, when there are more than 3 lines to be scrolled.
If you are using a color <A HREF="terminal.html#terminal">terminal</A> that is slow, use this command:
<B> hi NonText cterm=NONE ctermfg=NONE</B>
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 <A HREF="terminal.html#terminal">terminal</A> I/O quite
a bit.
If you are <A HREF="eval.html#testing">testing</A> <A HREF="#termcap">termcap</A> <A HREF="options.html#options">options</A>, but you cannot see what is happening,
you might want to set the <A HREF="options.html#'writedelay'">'writedelay'</A> option. When non-zero, one character
is sent to the <A HREF="terminal.html#terminal">terminal</A> at a time (does not work for <A HREF="os_msdos.html#MS-DOS">MS-DOS</A>). This makes the
screen updating a lot slower, making <A HREF="motion.html#it">it</A> possible to see what is happening.
==============================================================================
5. Using the mouse *<A NAME="mouse-using"></A><B>mouse-using</B>*
This section is about using the mouse on a <A HREF="terminal.html#terminal">terminal</A> or a <A HREF="terminal.html#terminal">terminal</A> <A HREF="windows.html#window">window</A>. How
to use the mouse in a <A HREF="gui.html#GUI">GUI</A> <A HREF="windows.html#window">window</A> is explained in |<A HREF="gui.html#gui-mouse">gui-mouse</A>|. For <A HREF="scroll.html#scrolling">scrolling</A>
with a mouse wheel see |<A HREF="scroll.html#scroll-mouse-wheel">scroll-mouse-wheel</A>|.
Don't forget to enable the mouse with this command:
<B> :set mouse=a</B>
Otherwise Vim won't recognize the mouse in all modes (See <A HREF="options.html#'mouse'">'mouse'</A>).
Currently the mouse is supported for <A HREF="os_unix.html#Unix">Unix</A> in an xterm <A HREF="windows.html#window">window</A>, in a *BSD
console with |<A HREF="#sysmouse">sysmouse</A>|, in a Linux console (with GPM |<A HREF="#gpm-mouse">gpm-mouse</A>|), for
<A HREF="os_msdos.html#MS-DOS">MS-DOS</A> and in a Windows console.
Mouse clicks can be used to position the cursor, select an area and paste.
These characters in the <A HREF="options.html#'mouse'">'mouse'</A> option tell in which situations the mouse will
be used by Vim:
<A HREF="pattern.html#n">n</A> <A HREF="intro.html#Normal">Normal</A> mode
<A HREF="visual.html#v">v</A> <A HREF="visual.html#Visual">Visual</A> mode
<A HREF="insert.html#i">i</A> <A HREF="insert.html#Insert">Insert</A> mode
<A HREF="change.html#c">c</A> <A HREF="cmdline.html#Command-line">Command-line</A> mode
<A HREF="motion.html#h">h</A> all previous modes when in a help file
a all previous modes
r for |<A HREF="message.html#hit-enter">hit-enter</A>| prompt
The default for <A HREF="options.html#'mouse'">'mouse'</A> is empty, the mouse is not used. Normally you would
<A HREF="diff.html#do">do</A>:
<B> :set mouse=a</B>
to start using the mouse (this is equivalent to setting <A HREF="options.html#'mouse'">'mouse'</A> to "nvich").
If you only want to use the mouse in a few modes or also want to use <A HREF="motion.html#it">it</A> for
the two questions you will have to concatenate the letters for those modes.
For example:
<B> :set mouse=nv</B>
Will make the mouse work in <A HREF="intro.html#Normal">Normal</A> mode and <A HREF="visual.html#Visual">Visual</A> mode.
<B> :set mouse=h</B>
Will make the mouse work in help files only (so you can use "<A HREF="tagsrch.html#g<LeftMouse>">g<LeftMouse></A>" to
jump to <A HREF="tagsrch.html#tags">tags</A>).
Whether the selection that is started with the mouse is in <A HREF="visual.html#Visual">Visual</A> mode or
<A HREF="visual.html#Select">Select</A> mode depends on whether "mouse" is included in the <A HREF="options.html#'selectmode'">'selectmode'</A>
option.
In an xterm, with the currently active mode included in the <A HREF="options.html#'mouse'">'mouse'</A> option,
normal mouse clicks are used by Vim, mouse clicks with the <A HREF="intro.html#shift">shift</A> or <A HREF="intro.html#ctrl">ctrl</A> key
pressed go to the xterm. With the currently active mode not included in
<A HREF="options.html#'mouse'">'mouse'</A> all mouse clicks go to the xterm.
*<A NAME="xterm-clipboard"></A><B>xterm-clipboard</B>*
In the <A HREF="gui_x11.html#Athena">Athena</A> and <A HREF="gui_x11.html#Motif">Motif</A> <A HREF="gui.html#GUI">GUI</A> versions, when running in a <A HREF="terminal.html#terminal">terminal</A> and there is
access to the X-server (DISPLAY is set), the copy and paste will behave like
in the <A HREF="gui.html#GUI">GUI</A>. If not, the middle mouse button will insert the unnamed <A HREF="sponsor.html#register">register</A>.
In that <A HREF="change.html#case">case</A>, here is how you copy and paste a piece of text:
Copy/paste with the mouse and <A HREF="visual.html#Visual">Visual</A> mode ('mouse' option must be set, see
above):
1. Press left mouse button on first <A HREF="print.html#letter">letter</A> of text, move mouse pointer to last
<A HREF="print.html#letter">letter</A> of the text and release the button. This will start <A HREF="visual.html#Visual">Visual</A> mode and
highlight the selected area.
2. Press "<A HREF="change.html#y">y</A>" to <A HREF="change.html#yank">yank</A> the <A HREF="visual.html#Visual">Visual</A> text in the unnamed <A HREF="sponsor.html#register">register</A>.
3. Click the left mouse button at the insert position.
4. Click the middle mouse button.
Shortcut: If the insert position is on the screen at the same time <A HREF="motion.html#as">as</A> the
<A HREF="visual.html#Visual">Visual</A> text, you can <A HREF="diff.html#do">do</A> 2, 3 and 4 all in one: Click the middle mouse button
at the insert position.
Note: When the |<A HREF="starting.html#-X">-X</A>| command line argument is used, Vim will not connect to the
X server and copy/paste to the X <A HREF="gui.html#clipboard">clipboard</A> (selection) will not work. Use the
<A HREF="intro.html#shift">shift</A> key with the mouse buttons to let the xterm <A HREF="diff.html#do">do</A> the selection.
*<A NAME="xterm-command-server"></A><B>xterm-command-server</B>*
When the X-server <A HREF="gui.html#clipboard">clipboard</A> is available, the command server described in
|<A HREF="remote.html#x11-clientserver">x11-clientserver</A>| can be enabled with the <A HREF="remote.html#--servername">--servername</A> command line argument.
*<A NAME="xterm-copy-paste"></A><B>xterm-copy-paste</B>*
NOTE: In some (older) xterms, it's not possible to move the cursor past column
95 or 223. This is an xterm problem, not Vim's. Get a newer xterm
|<A HREF="syntax.html#color-xterm">color-xterm</A>|. Also see |<A HREF="options.html#'ttymouse'">'ttymouse'</A>|.
Copy/paste in xterm with (current mode NOT included in 'mouse'):
1. Press left mouse button on first <A HREF="print.html#letter">letter</A> of text, move mouse pointer to last
<A HREF="print.html#letter">letter</A> of the text and release the button.
2. Use normal Vim commands to put the cursor at the insert position.
3. Press "<A HREF="insert.html#a">a</A>" to start <A HREF="insert.html#Insert">Insert</A> mode.
4. Click the middle mouse button.
5. Press ESC to end <A HREF="insert.html#Insert">Insert</A> mode.
(The same can be done with anything in <A HREF="options.html#'mouse'">'mouse'</A> if you keep the <A HREF="intro.html#shift">shift</A> key
pressed while using the mouse.)
Note: if you lose the 8th bit when pasting (special characters are translated
into other characters), you may have to <A HREF="diff.html#do">do</A> "stty cs8 -istrip -parenb" in your
shell before starting Vim.
Thus in an xterm the <A HREF="intro.html#shift">shift</A> and <A HREF="intro.html#ctrl">ctrl</A> keys cannot be used with the mouse. Mouse
commands requiring the CTRL modifier can be simulated by typing the "<A HREF="index.html#g">g</A>" key
before using the mouse:
"<A HREF="tagsrch.html#g<LeftMouse>">g<LeftMouse></A>" is "<A HREF="tagsrch.html#<C-LeftMouse>"><C-LeftMouse></A> (jump to <A HREF="tagsrch.html#tag">tag</A> under mouse click)
"<A HREF="tagsrch.html#g<RightMouse>">g<RightMouse></A>" is "<A HREF="tagsrch.html#<C-RightMouse>"><C-RightMouse></A> ("CTRL-T")
*<A NAME="mouse-mode-table"></A><B>mouse-mode-table</B>* *<A NAME="mouse-overview"></A><B>mouse-overview</B>*
A short overview of what the mouse buttons <A HREF="diff.html#do">do</A>, when <A HREF="options.html#'mousemodel'">'mousemodel'</A> is "extend":
<A HREF="intro.html#Normal">Normal</A> Mode:
<B><FONT COLOR="PURPLE">event position selection change action </FONT></B>
<B><FONT COLOR="PURPLE"> cursor window </FONT></B>
<A HREF="visual.html#<LeftMouse>"><LeftMouse></A> yes end yes
<A HREF="tagsrch.html#<C-LeftMouse>"><C-LeftMouse></A> yes end yes "<A HREF="tagsrch.html#CTRL-]">CTRL-]</A>" (2)
<A HREF="#<S-LeftMouse>"><S-LeftMouse></A> yes no change yes "*" (2) *<A NAME="<S-LeftMouse>"></A><B><S-LeftMouse></B>*
<A HREF="#<LeftDrag>"><LeftDrag></A> yes start or extend (1) no *<A NAME="<LeftDrag>"></A><B><LeftDrag></B>*
<A HREF="visual.html#<LeftRelease>"><LeftRelease></A> yes start or extend (1) no
<A HREF="change.html#<MiddleMouse>"><MiddleMouse></A> yes if not active no put
<A HREF="change.html#<MiddleMouse>"><MiddleMouse></A> yes if active no <A HREF="change.html#yank">yank</A> and put
<A HREF="visual.html#<RightMouse>"><RightMouse></A> yes start or extend yes
<A HREF="#<A-RightMouse>"><A-RightMouse></A> yes start or extend blockw. yes *<A NAME="<A-RightMouse>"></A><B><A-RightMouse></B>*
<A HREF="#<S-RightMouse>"><S-RightMouse></A> yes no change yes "<A HREF="pattern.html##">#</A>" (2) *<A NAME="<S-RightMouse>"></A><B><S-RightMouse></B>*
<A HREF="tagsrch.html#<C-RightMouse>"><C-RightMouse></A> no no change no "<A HREF="tagsrch.html#CTRL-T">CTRL-T</A>"
<A HREF="#<RightDrag>"><RightDrag></A> yes extend no *<A NAME="<RightDrag>"></A><B><RightDrag></B>*
<A HREF="#<RightRelease>"><RightRelease></A> yes extend no *<A NAME="<RightRelease>"></A><B><RightRelease></B>*
<A HREF="insert.html#Insert">Insert</A> or <A HREF="insert.html#Replace">Replace</A> Mode:
<B><FONT COLOR="PURPLE">event position selection change action </FONT></B>
<B><FONT COLOR="PURPLE"> cursor window </FONT></B>
<A HREF="visual.html#<LeftMouse>"><LeftMouse></A> yes (cannot be active) yes
<A HREF="tagsrch.html#<C-LeftMouse>"><C-LeftMouse></A> yes (cannot be active) yes "CTRL-O^]" (2)
<A HREF="#<S-LeftMouse>"><S-LeftMouse></A> yes (cannot be active) yes "CTRL-O*" (2)
<A HREF="#<LeftDrag>"><LeftDrag></A> yes start or extend (1) no like <A HREF="motion.html#CTRL-O">CTRL-O</A> (1)
<A HREF="visual.html#<LeftRelease>"><LeftRelease></A> yes start or extend (1) no like <A HREF="motion.html#CTRL-O">CTRL-O</A> (1)
<A HREF="change.html#<MiddleMouse>"><MiddleMouse></A> no (cannot be active) no put <A HREF="sponsor.html#register">register</A>
<A HREF="visual.html#<RightMouse>"><RightMouse></A> yes start or extend yes like <A HREF="motion.html#CTRL-O">CTRL-O</A>
<A HREF="#<A-RightMouse>"><A-RightMouse></A> yes start or extend blockw. yes
<A HREF="#<S-RightMouse>"><S-RightMouse></A> yes (cannot be active) yes "CTRL-O#" (2)
<A HREF="tagsrch.html#<C-RightMouse>"><C-RightMouse></A> no (cannot be active) no "<A HREF="motion.html#CTRL-O">CTRL-O</A> CTRL-T"
In a help <A HREF="windows.html#window">window</A>:
<B><FONT COLOR="PURPLE">event position selection change action </FONT></B>
<B><FONT COLOR="PURPLE"> cursor window </FONT></B>
<A HREF="#<2-LeftMouse>"><2-LeftMouse></A> yes (cannot be active) no "^]" (jump to help <A HREF="tagsrch.html#tag">tag</A>)
When <A HREF="options.html#'mousemodel'">'mousemodel'</A> is "popup", these are different:
<A HREF="intro.html#Normal">Normal</A> Mode:
<B><FONT COLOR="PURPLE">event position selection change action </FONT></B>
<B><FONT COLOR="PURPLE"> cursor window </FONT></B>
<A HREF="#<S-LeftMouse>"><S-LeftMouse></A> yes start or extend (1) no
<A HREF="#<A-LeftMouse>"><A-LeftMouse></A> yes start or extend blockw. no *<A NAME="<A-LeftMouse>"></A><B><A-LeftMouse></B>*
<A HREF="visual.html#<RightMouse>"><RightMouse></A> no popup menu no
<A HREF="insert.html#Insert">Insert</A> or <A HREF="insert.html#Replace">Replace</A> Mode:
<B><FONT COLOR="PURPLE">event position selection change action </FONT></B>
<B><FONT COLOR="PURPLE"> cursor window </FONT></B>
<A HREF="#<S-LeftMouse>"><S-LeftMouse></A> yes start or extend (1) no like <A HREF="motion.html#CTRL-O">CTRL-O</A> (1)
<A HREF="#<A-LeftMouse>"><A-LeftMouse></A> yes start or extend blockw. no
<A HREF="visual.html#<RightMouse>"><RightMouse></A> no popup menu no
(1) only if mouse pointer moved since press
(2) only if click is in same buffer
Clicking the left mouse button causes the cursor to be positioned. If the
click is in another <A HREF="windows.html#window">window</A> that <A HREF="windows.html#window">window</A> is made the active <A HREF="windows.html#window">window</A>. When
editing the command-line the cursor can only be positioned on the
command-line. When in <A HREF="insert.html#Insert">Insert</A> mode Vim remains in <A HREF="insert.html#Insert">Insert</A> mode. If <A HREF="options.html#'scrolloff'">'scrolloff'</A>
is set, and the cursor is positioned within <A HREF="options.html#'scrolloff'">'scrolloff'</A> lines from the <A HREF="windows.html#window">window</A>
border, the text is scrolled.
A selection can be started by pressing the left mouse button on the first
character, moving the mouse to the last character, then releasing the mouse
button. You will not always see the selection until you release the button,
only in some versions (GUI, <A HREF="os_msdos.html#MS-DOS">MS-DOS</A>, WIN32) will the dragging be shown
immediately. Note that you can make the text scroll by moving the mouse at
least one character in the first/last line in the <A HREF="windows.html#window">window</A> when <A HREF="options.html#'scrolloff'">'scrolloff'</A> is
non-zero.
In <A HREF="intro.html#Normal">Normal</A>, <A HREF="visual.html#Visual">Visual</A> and <A HREF="visual.html#Select">Select</A> mode clicking the right mouse button causes the
<A HREF="visual.html#Visual">Visual</A> area to be extended. When <A HREF="options.html#'mousemodel'">'mousemodel'</A> is "popup", the left button has
to be used while keeping the <A HREF="intro.html#shift">shift</A> key pressed. When clicking in a <A HREF="windows.html#window">window</A>
which is editing another buffer, the <A HREF="visual.html#Visual">Visual</A> or <A HREF="visual.html#Select">Select</A> mode is stopped.
In <A HREF="intro.html#Normal">Normal</A>, <A HREF="visual.html#Visual">Visual</A> and <A HREF="visual.html#Select">Select</A> mode clicking the right mouse button with the <A HREF="intro.html#alt">alt</A>
key pressed causes the <A HREF="visual.html#Visual">Visual</A> area to become blockwise. When <A HREF="options.html#'mousemodel'">'mousemodel'</A> is
"popup" the left button has to be used with the <A HREF="intro.html#alt">alt</A> key. Note that this won't
work on systems where the <A HREF="windows.html#window">window</A> manager consumes the mouse events when the
<A HREF="intro.html#alt">alt</A> key is pressed (it may move the <A HREF="windows.html#window">window</A>).
*<A NAME="double-click"></A><B>double-click</B>*
Double, triple and quadruple clicks are supported when the <A HREF="gui.html#GUI">GUI</A> is active,
for <A HREF="os_msdos.html#MS-DOS">MS-DOS</A> and <A HREF="os_win32.html#Win32">Win32</A>, and for an xterm (if the gettimeofday() function is
available). For selecting text, extra clicks extend the selection:
<B><FONT COLOR="PURPLE"> click select </FONT></B>
double <A HREF="motion.html#word">word</A> or <A HREF="motion.html#%">%</A> match *<A NAME="<2-LeftMouse>"></A><B><2-LeftMouse></B>*
triple line *<A NAME="<3-LeftMouse>"></A><B><3-LeftMouse></B>*
quadruple rectangular block *<A NAME="<4-LeftMouse>"></A><B><4-LeftMouse></B>*
Exception: In a Help <A HREF="windows.html#window">window</A> a double click jumps to help for the <A HREF="motion.html#word">word</A> that is
clicked on.
A double click on a <A HREF="motion.html#word">word</A> selects that <A HREF="motion.html#word">word</A>. <A HREF="options.html#'iskeyword'">'iskeyword'</A> is used to specify
which characters are included in a <A HREF="motion.html#word">word</A>. A double click on a character
that has a match selects until that match (like using "v%"). If the match is
an #if/#else/#endif block, the selection becomes <A HREF="motion.html#linewise">linewise</A>.
For <A HREF="os_msdos.html#MS-DOS">MS-DOS</A> and xterm the time for double clicking can be set with the
<A HREF="options.html#'mousetime'">'mousetime'</A> option. For the other systems this time is defined outside of
Vim.
An example, for using a double click to jump to the <A HREF="tagsrch.html#tag">tag</A> under the cursor:
<B> :map <2-LeftMouse> :exe "tag ". expand("<cword>")<CR></B>
Dragging the mouse with a double click (button-down, button-up, button-down
and then drag) will result in whole words to be selected. This continues
until the button is released, at which point the selection is per character
again.
*<A NAME="gpm-mouse"></A><B>gpm-mouse</B>*
The GPM mouse is only supported when the |<A HREF="various.html#+mouse_gpm">+mouse_gpm</A>| feature was enabled at
compile time. The GPM mouse driver (Linux console) does not support quadruple
clicks.
In <A HREF="insert.html#Insert">Insert</A> mode, when a selection is started, Vim goes into <A HREF="intro.html#Normal">Normal</A> mode
temporarily. When <A HREF="visual.html#Visual">Visual</A> or <A HREF="visual.html#Select">Select</A> mode ends, <A HREF="motion.html#it">it</A> returns to <A HREF="insert.html#Insert">Insert</A> mode.
This is like using <A HREF="motion.html#CTRL-O">CTRL-O</A> in <A HREF="insert.html#Insert">Insert</A> mode. <A HREF="visual.html#Select">Select</A> mode is used when the
<A HREF="options.html#'selectmode'">'selectmode'</A> option contains "mouse".
*<A NAME="sysmouse"></A><B>sysmouse</B>*
The sysmouse is only supported when the |<A HREF="various.html#+mouse_sysmouse">+mouse_sysmouse</A>| feature was enabled
at compile time. The <A HREF="#sysmouse">sysmouse</A> driver (*BSD console) does not support keyboard
modifiers.
*<A NAME="drag-status-line"></A><B>drag-status-line</B>*
When working with several <A HREF="windows.html#windows">windows</A>, the size of the <A HREF="windows.html#windows">windows</A> can be changed by
dragging the status line with the mouse. Point the mouse at a status line,
press the left button, move the mouse to the new position of the status line,
release the button. Just clicking the mouse in a status line makes that <A HREF="windows.html#window">window</A>
the current <A HREF="windows.html#window">window</A>, without moving the cursor. If by selecting a <A HREF="windows.html#window">window</A> <A HREF="motion.html#it">it</A>
will change position or size, the dragging of the status line will look
confusing, but <A HREF="motion.html#it">it</A> will work (just try <A HREF="motion.html#it">it</A>).
*<A NAME="<MiddleRelease>"></A><B><MiddleRelease></B>* *<A NAME="<MiddleDrag>"></A><B><MiddleDrag></B>*
Mouse clicks can be mapped. The codes for mouse clicks are:
<B><FONT COLOR="PURPLE"> code mouse button normal action </FONT></B>
<A HREF="visual.html#<LeftMouse>"><LeftMouse></A> left pressed set cursor position
<A HREF="#<LeftDrag>"><LeftDrag></A> left moved while pressed extend selection
<A HREF="visual.html#<LeftRelease>"><LeftRelease></A> left released set selection end
<A HREF="change.html#<MiddleMouse>"><MiddleMouse></A> middle pressed paste text at cursor position
<A HREF="#<MiddleDrag>"><MiddleDrag></A> middle moved while pressed -
<A HREF="#<MiddleRelease>"><MiddleRelease></A> middle released -
<A HREF="visual.html#<RightMouse>"><RightMouse></A> right pressed extend selection
<A HREF="#<RightDrag>"><RightDrag></A> right moved while pressed extend selection
<A HREF="#<RightRelease>"><RightRelease></A> right released set selection end
<X1Mouse> X1 button pressed - *<A NAME="X1Mouse"></A><B>X1Mouse</B>*
<X1Drag> X1 moved while pressed - *<A NAME="X1Drag"></A><B>X1Drag</B>*
<X1Release> X1 button release - *<A NAME="X1Release"></A><B>X1Release</B>*
<X2Mouse> X2 button pressed - *<A NAME="X2Mouse"></A><B>X2Mouse</B>*
<X2Drag> X2 moved while pressed - *<A NAME="X2Drag"></A><B>X2Drag</B>*
<X2Release> X2 button release - *<A NAME="X2Release"></A><B>X2Release</B>*
The X1 and X2 buttons refer to the extra buttons found on some mice. The
'Microsoft Explorer' mouse has these buttons available to the right thumb.
Currently X1 and X2 only work on <A HREF="os_win32.html#Win32">Win32</A> and <A HREF="options.html#X11">X11</A> environments.
Examples:
<B> :noremap <MiddleMouse> <LeftMouse><MiddleMouse></B>
Paste at the position of the middle mouse button click (otherwise the paste
would be done at the cursor position).
<B> :noremap <LeftRelease> <LeftRelease>y</B>
Immediately <A HREF="change.html#yank">yank</A> the selection, when using <A HREF="visual.html#Visual">Visual</A> mode.
Note the use of "<A HREF="map.html#:noremap">:noremap</A>" instead of "map" to avoid a recursive <A HREF="map.html#mapping">mapping</A>.
<B> :map <X1Mouse> <C-O></B>
<B> :map <X2Mouse> <C-I></B>
Map the X1 and X2 buttons to go forwards and backwards in the jump <A HREF="eval.html#list">list</A>, see
|<A HREF="motion.html#CTRL-O">CTRL-O</A>| and |<A HREF="motion.html#CTRL-I">CTRL-I</A>|.
*<A NAME="mouse-swap-buttons"></A><B>mouse-swap-buttons</B>*
To swap the meaning of the left and right mouse buttons:
<B> :noremap <LeftMouse> <RightMouse></B>
<B> :noremap <LeftDrag> <RightDrag></B>
<B> :noremap <LeftRelease> <RightRelease></B>
<B> :noremap <RightMouse> <LeftMouse></B>
<B> :noremap <RightDrag> <LeftDrag></B>
<B> :noremap <RightRelease> <LeftRelease></B>
<B> :noremap g<LeftMouse> <C-RightMouse></B>
<B> :noremap g<RightMouse> <C-LeftMouse></B>
<B> :noremap! <LeftMouse> <RightMouse></B>
<B> :noremap! <LeftDrag> <RightDrag></B>
<B> :noremap! <LeftRelease> <RightRelease></B>
<B> :noremap! <RightMouse> <LeftMouse></B>
<B> :noremap! <RightDrag> <LeftDrag></B>
<B> :noremap! <RightRelease> <LeftRelease></B>
<A HREF="#top">top</A> - <A HREF="index.html">main help file</A>
</PRE>
</BODY>
</HTML>
|