/usr/share/elvis/manual/elvisvi.html is in elvis-common 2.2.0-11.1.
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 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 | <html><head>
<title>Elvis-2.2_0 Visual Command Mode</title>
</head><body>
<h1>2. VISUAL COMMAND MODE</h1>
Most visual mode commands are one keystroke long.
The following tables list the operation performed by each keystroke,
and also denotes any options or arguments that it accepts.
<p> In addition to the keys listed here, your keyboard's "arrow" keys
will be interpreted as the appropriate cursor movement commands.
The same goes for (PgUp) and (PgDn), if your keyboard has them.
The (Insert) key will toggle between insert mode and replace mode.
There is a colon mode command (":map", to be described later)
which will allow you to define other keys, such as function keys.
<p> A tip: visual command mode looks a lot like text input mode.
If you forget which mode you're in, just hit the (Esc) key.
If Elvis beeps, then you're in visual command mode.
If Elvis does not beep, then you were in input mode,
but by hitting (Esc) you will have switched to visual command mode.
So, one way or another, after (Esc) Elvis will be ready for a command.
<h2>2.1 Notation</h2>
The following notation is used in the tables that follow...
<dl>
<dt>count<dd>
Many commands may be preceded by a count.
This is a sequence of digits representing a decimal number.
For most commands that use a count,
the command is repeated <var>count</var> times,
but a few commands use the count value for some completely different purpose.
The count is always optional, and usually defaults to 1.
<dt>key<dd>
Some commands require two keystrokes. The first key always determines
which command is to be executed. The second key is used as a parameter
to the command.
<dt>mv<dd>
Some commands
(<a href="#bang">!</a> <a href="#lt"><</a> <a href="#gt">></a>
<a href="#=">=</a> <a href="#c">c</a> <a href="#d">d</a> <a href="#y">y</a>
<a href="#g=">g=</a> <a href="#g~">g~</a> <a href="#gu">gu</a>
<a href="#gU">gU</a>)
operate on text between the cursor and some other position.
Usually, the other position is specified by typing a movement command
after the operator command, but there are other options.
See the section on <a href="#operators">operators</a> for more information.
These commands can also be used with <a href="#textobject">text objects</a>.
<dt>inp<dd>
Many commands allow the user to interactively enter text.
See the discussion of "input mode" in the following chapter.
</dl>
<h3><a name="textobject"></a>2.1.1 Text objects</h3>
Traditionally, the <a href="#operators">operator</a> commands could
only act on text between the cursor position, and the location that a motion
command would move the cursor to.
Earlier versions of Elvis added visual marking as another alternative.
More recently, the <a href="elvistip.html#clones">vim</a> editor added
text objects as yet another alternative.
Elvis now supports text objects too.
<p>Each type of text object has a two-character name.
The first character is 'a' for the whole object including surrounding text,
or 'i' for just the "inner" part of the object without any surrounding text.
The second character describes how the object's endpoints are to be found.
<pre graphic>
.----------.-----------------------------------------------------.
| 2nd char | Extent of the text object |
|----------|-----------------------------------------------------|
| w | word or punctuation string, like <a href="#b">b</a> <a href="#e">e</a> <a href="#w">w</a> commands |
| W | whitespace-delimited word, like <a href="#B">B</a> <a href="#E">E</a> <a href="#W">W</a> commands |
| s | sentence, like <a href="#open">(</a> <a href="#close">)</a> commands |
| p | paragraph, like <a href="#ocur">{</a> <a href="#ccur">}</a> commands |
| S | section, like <a href="#obra">[[</a> <a href="#cbra">]]</a> commands |
| { [ ( < | block delimited by the previous {[(< and its match |
| } ] ) > | block delimited by the following }])> and its match |
| % | block delimited by any of {[( and its match |
| b | block delimited by parentheses, like a( or i( |
| B | block delimited by braces, like a{ or i{ |
| L | group of lines with same or greater indentation |
| l | individual lines (i.e. fields delimited by newlines)|
| x | XML/SGML <tag>...</tag> pair, case sensitive |
| X | HTML <tag>...</tag> pair, case insensitive |
| t | field, delimited by tabs |
| other | field, delimited at both ends by the character or \n|
^----------^-----------------------------------------------------^</pre>
<p>The use of uppercase <code>S</code> for sections,
<code>%</code> for any brace-delimited block,
<code>L</code> for an indentation-delimited block,
<code>l</code> for lines,
<code>x</code> and <code>X</code> for tag pairs,
<code>t</code> for tab fields,
and other punctuation for field delimiters
are all extensions beyond vim's text objects.
<p>For block text objects, the 'a' version includes the
delimiting characters, while the 'i' version excludes them.
The "aL" object includes surrounding blank lines, while "iL" excludes those
lines plus the leading whitespace of the first line the trailing newline
of the last line.
For XML objects, the 'a' version includes the tags and the 'i' version
excludes them.
For field text objects, the 'a' version includes the trailing delimiter but
not the leading one, while the 'i' version omits both delimiters and any
leading whitespace.
For the other text objects, the 'a' version includes trailing whitespace
(or leading whitespace if there is no trailing whitespace), and the 'i'
version is just the object itself without the surrounding whitespace.
<p>Text objects accept counts.
For blocks and XML tag pairs, the count is the number of levels of nested brackets/tag pairs to skip.
For fields, the count is the number of delimiters to skip <em>in both directions</em>, so a count of <var>n</var> selects <var>2n-1</var> objects centered around the cursor.
For other text objects, the count is the number of consecutive objects
to use, starting with the current one.
For example, "<code>3daw</code>" deletes three words,
while "<code>3dab</code>" moves outward three levels of parentheses
and then deletes that single large block.
"<code>3dal</code>" deletes five lines centered around the cursor.
<p>The <a href="elvisopt.html#matchchar">matchchar</a> option can accept
object names in addition to character pairs.
For example, if you "<code>:set matchchar=(){}[]ax</code>" then the
<a href="elvisvi.html#pct">%</a> command will bounce between the endpoints
of an XML tag pair.
If you also set the <a href="elvisopt.html#showmatch">showmatch</a> option,
then when you type the "<kbd>></kbd>" of the closing tag,
Elvis will highlight the entire opening tag.
<p>Also, the <a href="elvisopt.html#hllayers">hllayers</a> and
<a href="elvisopt.html#hlobject">hlobject</a> options can be used together
to highlight objects around the cursor.
For example, "<code>:set hllayers=1 hlobject=al</code>" will cause the
current line to be highlighted.
<h2><a name="group"></a><a name="GROUP"></a>2.2 Visual Commands, Grouped by Function</h2>
<menu>
<li><a href="#2.2.1"> 2.2.1 Edit commands</a>
<li><a href="#2.2.2"> 2.2.2 Edit commands which are operators</a>
<li><a href="#2.2.3"> 2.2.3 Edit commands which are shortcuts for operators</a>
<li><a href="#2.2.4"> 2.2.4 Movement commands which move by a line or column</a>
<li><a href="#2.2.5"> 2.2.5 Movement commands which are window-relative</a>
<li><a href="#2.2.6"> 2.2.6 Movement commands which search for strings</a>
<li><a href="#2.2.7"> 2.2.7 Movement commands which search for characters</a>
<li><a href="#2.2.8"> 2.2.8 Movement commands which move by words</a>
<li><a href="#2.2.9"> 2.2.9 Movement commands which move by sentences or sections</a>
<li><a href="#2.2.10"> 2.2.10 Movement/mark commands</a>
<li><a href="#2.2.11"> 2.2.11 Scrolling commands</a>
<li><a href="#2.2.12"> 2.2.12 Window commands</a>
<li><a href="#2.2.13"> 2.2.13 Other commands</a>
</menu>
<h3><a name="2.2.1"></a>2.2.1 Edit commands</h3>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| <a href="#P">P</a> | Paste text before the cursor |
| <a href="#p">p</a> | Paste text after the cursor |
| count <a href="#J">J</a> | Join lines, to form one big line |
| count <a href="#gJ">gJ</a> | Join lines without adding whitespace |
| count <a href="#X">X</a> | Delete the character(s) to the left of the cursor |
| count <a href="#x">x</a> | Delete the character that the cursor's on |
| count <a href="#~">~</a> | Switch a character between uppercase & lowercase |
| count <a href="#r">r</a> key | Replace "count" chars by a given character |
| <a href="#R">R</a> inp | Overtype |
| count <a href="#a">a</a> inp | Insert text after the cursor |
| count <a href="#A">A</a> inp | Append at end of the line |
| count <a href="#i">i</a> inp | Insert text at the cursor |
| count <a href="#I">I</a> inp | Insert at the front of the line (after indents) |
| count <a href="#gI">gI</a> inp | Input at start of line (before indents) |
| count <a href="#o">o</a> inp | Open a new line below the current line |
| count <a href="#O">O</a> inp | Open up a new line above the current line |
| count <a href="#stop">.</a> | Repeat the previous "edit" command |
| count <a href="#u">u</a> | Undo the previous edit command |
| count <a href="#^R">^R</a> | Redo commands which were undone by the u command |
| <a href="#U">U</a> | Undo all recent changes to the current line |
^--------------^------------------------------------------------------^
</pre>
<dl>
<dt>P
<br>p
<dd><a name="P"></a><a name="p"></a>
The <kbd>P</kbd> and <kbd>p</kbd> commands paste text from a cut buffer.
The difference between them is that <kbd>p</kbd> pastes after the cursor,
and <kbd>P</kbd> pastes before it.
See the section on <a href="elviscut.html">cut buffers</a> for more information.
<dt><var>count</var> J
<br><var>count</var> gJ
<dd><a name="J"></a><a name="gJ"></a>
The <kbd>J</kbd> and <kbd>gJ</kbd> commands join the current line with the
following line.
If you supply a count argument, then they will join that many lines together,
starting at the current line.
The difference between these commands is that <kbd>J</kbd> will add whitespace
between the lines, while <kbd>gJ</kbd> will not.
These commands resemble the <a href="elvisex.html#join">:join</a> command
without and with a "!" suffix, respectively.
<dt><var>count</var> X
<br><var>count</var> x
<dd><a name="X"></a><a name="x"></a>
The <kbd>X</kbd> and <kbd>x</kbd> commands delete characters.
The difference between them is that <kbd>x</kbd> deletes the character at
the cursor, and <kbd>X</kbd> deletes the character before the cursor.
If you supply a count, then it will delete that many characters.
The deleted characters are copied into a cut buffer.
The <kbd>X</kbd> and <kbd>x</kbd> commands never delete newline characters.
<dt><var>count</var> ~
<dd><a name="~"></a>
The <kbd>~</kbd> command changes uppercase letters to lowercase, or
vice versa, and moves the cursor forward.
Non-letters are unaffected, but the cursor will still be moved forward.
<dt><var>count</var> r <var>key</var>
<dd><a name="r"></a>
The <kbd>r</kbd> command replaces a single character in the edit buffer with
a single character read from the keyboard.
If you supply a count, then it will replace that many characters in the
edit buffer with multiple copies of a single character from the keyboard.
<dt>R <var>inp</var>
<dd><a name="R"></a>
The <kbd>R</kbd> command switches the window to "replace mode" which is a
variation of <a href="elvisinp.html">input mode</a>.
<dt><var>count</var> a <var>inp</var>
<dd><a name="a"></a>
The <kbd>a</kbd> command switches to <a href="elvisinp.html">input mode</a>
with the cursor starting immediately after its previous position.
If a count is supplied, then after you manually insert the first copy of
the new text, Elvis will automatically insert <var>count-1</var>
additional copies.
<dt><var>count</var> A <var>inp</var>
<dd><a name="A"></a>
The <kbd>A</kbd> command switches to <a href="elvisinp.html">input mode</a>
with the cursor starting at the end of the current line.
If a count is supplied, then after you manually insert the first copy of
the new text, Elvis will automatically insert <var>count-1</var>
additional copies.
<dt><var>count</var> i <var>inp</var>
<dd><a name="i"></a>
The <kbd>i</kbd> command switches to <a href="elvisinp.html">input mode</a>
with the cursor starting at its current position.
If a count is supplied, then after you manually insert the first copy of
the new text, Elvis will automatically insert <var>count-1</var>
additional copies.
<dt><var>count</var> I <var>inp</var>
<dd><a name="I"></a>
The <kbd>I</kbd> command switches to <a href="elvisinp.html">input mode</a>
with the cursor starting at the beginning of the current line.
If a count is supplied, then after you manually insert the first copy of
the new text, Elvis will automatically insert <var>count-1</var>
additional copies.
<dt><var>count</var> gI <var>inp</var>
<dd><a name="gI"></a>
The <kbd>gI</kbd> command resembles the <a href="#I">I</a> command,
except that <kbd>gI</kbd> always inserts at the start of the line,
<em>before</em> any indentation, while <kbd>I</kbd> inserts <em>after</em>
indentation.
<dt><var>count</var> o <var>inp</var>
<dd><a name="o"></a>
The <kbd>o</kbd> command switches to <a href="elvisinp.html">input mode.</a>
A new, blank line is created after the current line, and the cursor
starts at the beginning of that new line.
If a count is supplied, then after you manually insert the first copy of
the new text, Elvis will automatically insert <var>count-1</var>
additional copies.
<dt><var>count</var> O <var>inp</var>
<dd><a name="O"></a>
The <kbd>O</kbd> command switches to <a href="elvisinp.html">input mode.</a>
A new, blank line is created before the current line, and the cursor
starts at the beginning of that new line.
If a count is supplied, then after you manually insert the first copy of
the new text, Elvis will automatically insert <var>count-1</var>
additional copies.
<dt><var>count</var> .
<dd><a name="stop"></a>
The <kbd>.</kbd> command repeats the previous command which changed text.
If a count is supplied, it overrides count of the original command.
<dt><var>count</var> u
<dd><a name="u"></a>
The <kbd>u</kbd> command undoes the previous edit command.
If a count is supplied, then it will undo that many changes, within
the limit defined by the <a href="elvisopt.html#undolevels">undolevels</a>
option.
<dt><var>count</var> ^R
<dd><a name="^R"></a>
The <kbd>^R</kbd> command redoes commands which were undone by the <kbd>u</kbd>
command.
Essentially it undoes the "undo".
<dt>U
<dd><a name="U"></a>
The <kbd>U</kbd> command undoes all changes which were made to the current
line since the cursor was moved onto it.
</dl>
<h3><a name="2.2.2"></a><a name="operators"></a>
2.2.2 Edit commands which are operators</h3>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| <a href="#lt"><</a> mv | Shift text left |
| <a href="#gt">></a> mv | Shift text right |
| <a href="#bang">!</a> mv text | Run selected lines thru an external filter program |
| <a href="#=">=</a> mv | Reformat |
| <a href="#c">c</a> mv inp | Change text |
| <a href="#d">d</a> mv | Delete text |
| <a href="#y">y</a> mv | Yank text (copy it into a cut buffer) |
| <a href="#g=">g=</a> key mv | Convert text to an equal number of <var>key</var> characters |
| <a href="#gU">gU</a> mv | Convert text to uppercase |
| <a href="#gu">gu</a> mv | Convert text to lowercase |
| <a href="#g~">g~</a> mv | Toggle text between uppercase & lowercase |
^--------------^------------------------------------------------------^
</pre>
These commands all affect text between the cursor's current position and
some other position.
There are four ways that you can specify that other position:
<ul>
<li>Follow the command keystroke with a movement command.
For example, <kbd>dw</kbd> deletes a single word.
<kbd>d3w</kbd> and <kbd>3dw</kbd> both delete three words.
<li>
Type the command keystroke twice.
This causes whole lines to be acted upon.
For example, <kbd>>></kbd> indents the current line.
<kbd>3>></kbd> indents the current line and the following two lines.
<li>
Follow the command keystroke with a <a href="#textobject">text object</a> name.
The command will affect the entire object, even if the cursor isn't located
at either endpoint.
For example, <kbd>dap</kbd> deletes a whole paragraph.
<li>
Move the cursor to one end of the text,
type <a href="#v">v</a>, <a href="#V">V</a>, or <a href="#^V">^V</a> to start marking,
move the cursor to the other end,
and then type the desired operator command key.
</ul>
<p>
The "g" operators (<a href="#g=">g=</a>, <a href="#gU">gU</a>,
<a href="#gu">gu</a>, and <a href="#g~">g~</a>) are only available if
Elvis has been compiled with FEATURE_G enabled.
In <a href="elvisexp.html">arithmetic expressions</a> you can use the
<a href="elvisexp.html#feature">feature("g")</a> function to test for this.
<dl>
<dt>< <var>mv</var>
<br>> <var>mv</var>
<dd><a name="lt"></a><a name="gt"></a>
These commands adjust the indentation of lines.
The <kbd><</kbd> command reduces indentation by <a href="elvisopt.html#shiftwidth">shiftwidth</a>
columns, and the <kbd>></kbd> command increases indentation by the same amount.
The type of whitespace used for the new indentation is determined by the
<a href="elvisopt.html#autotab">autotab</a> option.
The doubled-up <kbd><<</kbd> and <kbd>>></kbd> commands reduce or
increase the indentation for the current line, respectively.
<dt>! <var> mv text</var>
<dd><a name="bang"></a>
This command prompts you to enter a shell command line at the bottom of the
window.
When you've entered the command line, that command is executed and the selected
text is piped through it.
The resulting text replaces the original selected text.
For example, <kbd>10!!sort</kbd> will send 10 lines through the sort program.
<dt>= <var>mv</var>
<dd><a name="="></a>
When applied to lines, this command resembles the <kbd>!</kbd> command,
except that instead of prompting for a command line, the <kbd>=</kbd> command
will always execute the program specified via the
<a href="elvisopt.html#equalprg">equalprg</a> option.
If you expect to be running the same filter program over and over again,
then <kbd>=</kbd> is more convenient.
<p>When applied to characters selected via the <a href="#v">v</a> command,
the <kbd>=</kbd> command uses Elvis' built-in
calculator to evaluate the characters, and then replaces the original text
with the result of that evaluation.
For example, if you move the cursor to the start of a parenthesized
arithmetic expression and hit <kbd>v%=</kbd>
then the expression will be simplified.
<dt>c <var>mv inp</var>
<dd><a name="c"></a>
This command puts you in <a href="elvisinp.html">input mode</a> so you
can replace the selected text with new, manually-entered text.
The doubled-up <kbd>cc</kbd> command changes the current line.
<dt>d <var>mv</var>
<br>y <var>mv</var>
<dd><a name="d"></a><a name="y"></a>
These commands copy the selected text into a cut buffer.
The <kbd>d</kbd> command then deletes the text from the edit buffer,
but <kbd>y</kbd> leaves the original text intact.
The doubled-up <kbd>dd</kbd> and <kbd>yy</kbd> commands delete or yank the
current line, respectively.
<dt>g= <var>key mv</var>
<dd><a name="g="></a>
The <kbd>g=</kbd> operator replaces every character (except newlines) with
the <var>key</var> character.
<dt>gU <var>mv</var>
<br>gu <var>mv</var>
<br>g~ <var>mv</var>
<dd><a name="gU"></a><a name="gu"></a><a name="g~"></a>
These commands convert text between uppercase and lowercase.
The <kbd>gU</kbd> operator converts lowercase to uppercase,
while <kbd>gu</kbd> does the reverse.
The <kbd>g~</kbd> toggles each letter between uppercase and lowercase.
<p>
The difference between <kbd>g~</kbd> and <a href="#~">~</a> is that
<kbd>g~</kbd> is an operator, while <kbd>~</kbd> simply changes the
characters immediately without waiting for a motion or text object.
</dl>
<h3><a name="2.2.3"></a>2.2.3 Edit commands which are shortcuts for operators</h3>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| <a href="#C">C</a> inp | Change text from the cursor to the end of the line |
| <a href="#D">D</a> | Delete text from the cursor to the end of the line |
| count <a href="#S">S</a> inp | Change lines, like "count" cc |
| count <a href="#s">s</a> inp | Replace characters, like "count" cl |
| count <a href="#Y">Y</a> | Yank text line(s) (copy them into a cut buffer) |
^--------------^------------------------------------------------------^
</pre>
<dl>
<dt>C <var>inp</var>
<br>D
<br><var>count</var> S <var>inp</var>
<br><var>count</var> s <var>int</var>
<br><var>count</var> Y
<dd><a name="C"></a><a name="D"></a><a name="S"></a><a name="s"></a><a name="Y"></a>
All of these commands are shortcuts for particular operator/movement
command combinations.
<kbd>C</kbd> is short for <kbd>c$</kbd>,
<kbd>D</kbd> is short for <kbd>d$</kbd>,
uppercase <kbd>S</kbd> is short for <kbd>cc</kbd>,
lowercase <kbd>s</kbd> is short for <kbd>cl</kbd>, and
<kbd>Y</kbd> is short for <kbd>yy</kbd>.
</dl>
<h3><a name="2.2.4"></a>2.2.4 Movement commands which move by a line or column</h3>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| <a href="#0">0</a> | If not part of count, move to 1st char of this line |
| <a href="#^">^</a> | Move to the front of the current line (after indent) |
| <a href="#dollar">$</a> | Move to the rear of the current line |
| count <a href="#bar">|</a> | Move to column "count" (defaulting to column 1) |
| count <a href="#^X">^X</a> | Move to column "count" (defaulting to the right edge)|
| count <a href="#^M">^M</a> | Move to the front of the next line |
| count <a href="#+">+</a> | Move to the front of the next line |
| count <a href="#-">-</a> | Move to the front of the preceding line |
| count <a href="#G">G</a> | Move to line #"count" (default is the bottom line) |
| count <a href="#h">h</a> | Move left |
| count <a href="#^H">^H</a> | Move left |
| count <a href="#l">l</a> | Move right |
| count <a href="#l">Space</a> | Move right |
| count <a href="#j">j</a> | Move down |
| count <a href="#^J">^J</a> | Move down |
| count <a href="#^N">^N</a> | Move down |
| count <a href="#k">k</a> | Move up |
| count <a href="#^P">^P</a> | Move up |
| count <a href="#_">_</a> | Move to the current line |
^--------------^------------------------------------------------------^
</pre>
<dl>
<dt>0
<dd><a name="0"></a>
The <kbd>0</kbd> command moves the cursor to the first character in the
current line.
<dt>^
<dd><a name="^"></a>
The <kbd>^</kbd> command moves the cursor to the first non-whitespace
character in the current line.
If the current line doesn't contain any non-whitespace characters, then the
cursor is moved to the end of the line.
<dt>$
<dd><a name="dollar"></a>
The <kbd>$</kbd> command moves the cursor to the last character in the line.
<dt><var>count</var> |
<br><var>count</var> ^X
<dd><a name="bar"></a><a name="^X"></a>
These commands move the cursor to a given column.
The leftmost column is designated "column 1."
If the cursor can't be moved to the exact column number requested
(e.g., because the line isn't that long, or
the requested column falls in the middle of a tab character),
then Elvis will move the cursor as close as possible.
If no count is given, then the <kbd>|</kbd> command moves the cursor to
column 1 and the <kbd>^X</kbd> move the cursor to the rightmost visible
column (taking side scrolling into account).
<dt><var>count</var> ^M
<br><var>count</var> +
<dd><a name="^M"></a><a name="+"></a>
The <kbd>^M</kbd> and <kbd>+</kbd> commands move the cursor down
<var>count</var> lines (or 1 line if no count is given), and then
to the first non-whitespace character in that destination line.
It is equivalent to a <kbd>j</kbd> command followed by a <kbd>^</kbd> command.
<dt><var>count</var> -
<dd><a name="-"></a>
The <kbd>-</kbd> command moves the cursor up <var>count</var> lines
(or 1 line if no count is given), and then to the first non-whitespace
character in that destination line.
It is equivalent to a <kbd>k</kbd> command followed by a <kbd>^</kbd> command.
<dt><var>count</var> G
<dd><a name="G"></a>
The <kbd>G</kbd> command moves the cursor directly to the start of a given
line, or to the last line if no count is given.
<p>For the purposes of this command,
the "line number" of the cursor position is defined to be one plus the number
of newline characters which precede it in the buffer.
This definition is used regardless of what
<a href="elvisdm.html">display mode</a> you happen to be using.
The <a href="elvisopt.html#number">number</a> and
<a href="elvisopt.html#ruler">ruler</a> options use the same definition.
<dt><var>count</var> h
<br><var>count</var> ^H
<dd><a name="h"></a><a name="^H"></a>
The <kbd>h</kbd> and <kbd>^H</kbd> commands move the cursor <var>count</var>
characters to the left, or 1 character leftward if no count is given.
They won't move the cursor past the beginning of the line.
<dt><var>count</var> l
<br><var>count</var> Space
<dd><a name="l"></a>
The <kbd>h</kbd> and <kbd>Space</kbd> commands move the cursor <var>count</var>
characters to the right, or 1 character rightward if no count is given.
They won't move the cursor past the end of the line.
<dt><var>count</var> j
<br><var>count</var> ^J
<br><var>count</var> ^N
<dd><a name="j"></a><a name="^J"></a><a name="^N"></a>
These commands all move the cursor down <var>count</var> lines
(or 1 line if no count is given), without changing the column
of the cursor if possible.
<dt><var>count</var> k
<br><var>count</var> ^P
<dd><a name="k"></a><a name="^P"></a>
These commands all move the cursor up <var>count</var> lines
(or 1 line if no count is given), without changing the column
of the cursor if possible.
<dt><var>count</var> _
<dd><a name="_"></a>
The <kbd>_</kbd> command moves the cursor down <var>count-1</var> lines.
This command is used internally to implement the double-operators; for
example, <a href="#lt"><<</a> is interpreted as <kbd><_</kbd>.
By itself the <kbd>_</kbd> command is pretty useless.
</dl>
<h3><a name="2.2.5"></a>2.2.5 Movement commands which are window-relative</h3>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| count <a href="#H">H</a> | Move to home row (the line at the top of the screen) |
| <a href="#M">M</a> | Move to middle row |
| count <a href="#L">L</a> | Move to last row (i.e., line at bottom of window) |
| <a href="#gdollar">g$</a> | Move to end of current row |
| <a href="#g0">g0</a> | Move to start of current row, before indent |
| <a href="#g^">g^</a> | Move to start of current row, after indent |
| count <a href="#gh">gh</a> | Move left, skipping invisible characters |
| count <a href="#gj">gj</a> | Move down 1 row (useful when lines wrap) |
| count <a href="#gk">gk</a> | Move up 1 row (useful when lines wrap) |
| count <a href="#gl">gl</a> | Move right, skipping invisible characters |
^--------------^------------------------------------------------------^
</pre>
<dl>
<dt><var>count</var> H
<dd><a name="H"></a>
The <kbd>H</kbd> command moves the cursor to the front of the first line
that is currently visible in the window.
If a count is given, then it will move down <var>count-1</var> lines from
the top of the window.
<dt>M
<dd><a name="M"></a>
The <kbd>M</kbd> command moves the cursor to the front of the line in
the middle of the window.
<dt><var>count</var> L
<dd><a name="L"></a>
The <kbd>L</kbd> command moves the cursor to the front of the line line
that is currently visible in the window.
If a count is given, then it will move up <var>count-1</var> lines from
the bottom of the window.
<dt>g0
<br>g^
<br>g$
<br><var>count</var> gj
<br><var>count</var> gk
<dd><a name="g0"></a><a name="g^"></a><a name="gdollar"></a><a name="gj"></a><a name="gk"></a>
These resemble the <a href="#0">0</a>, <a href="#^">^</a>, <a href="#$">$</a>,
<a href="#j">j</a>, and <a href="#k">k</a> commands,
except that these versions are sensitive to line wrapping or sideways scrolling.
For example, with the <a href="elvisopt.html#wrap">wrap</a> option
turned off, <kbd>g0</kbd> moves the cursor to the left edge of the screen
even if the screen has scrolled sideways to display a long line.
With <a href="elvisopt.html#wrap">wrap</a> turned on, if the cursor is on
a long line which wraps onto multiple rows of the display, <kbd>g0</kbd>
will move the cursor to the start of the current row, even if that row
isn't the line's first row.
<dt><var>count</var> gh
<br><var>count</var> gl
<dd><a name="gh"></a><a name="gl"></a>
These resemble the <a href="#h">h</a> and <a href="#l">l</a> commands,
except that these versions are smart enough to skip over hidden characters.
This is useful if you're moving through text in the
<a href="elvisdm.html#html">html</a>, <a href="elvisdm.html#man">man</a>, or
<a href="elvisdm.html#tex">tex</a> display modes.
</dl>
<h3><a name="2.2.6"></a>2.2.6 Movement commands which search for strings</h3>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| <a href="#slash">/</a> text | Search forward for a given regular expression |
| <a href="#quest">?</a> text | Search backward for a given regular expression |
| <a href="#^A">^A</a> | Search for next occurrence of word at cursor |
| <a href="#gD">gD</a> | Go to global definition of word at cursor |
| <a href="#gd">gd</a> | Go to local definition of word at cursor |
| <a href="#n">n</a> | Repeat the previous search |
| <a href="#N">N</a> | Repeat previous search, but in the opposite direction|
^--------------^------------------------------------------------------^
</pre>
All of these search commands are affected by the
<a href="elvisopt.html#magic">magic,</a>
<a href="elvisopt.html#ignorecase">ignorecase,</a>
<a href="elvisopt.html#wrapscan">wrapscan,</a> and
<a href="elvisopt.html#autoselect">autoselect</a> options.
<dl>
<dt>/ <var>text</var>
<br>? <var>text</var>
<dd><a name="slash"></a><a name="quest"></a>
These commands prompt you to enter a <a href="elvisre.html">regular expression</a>
at the bottom of the window.
When you have entered it, Elvis will search forward (for <kbd>/</kbd>) or
backward (for <kbd>?</kbd>) for text which matches the regular expression.
Normally the cursor is positioned at the start of the matching text.
If you want to include a <kbd>/</kbd> or <kbd>?</kbd> character
in the regular expression, you must precede it with a backslash;
otherwise it will be interpreted as a closing delimiter.
<p>When entering the regular expression, you can append a closing delimiter
(<kbd>/</kbd> or <kbd>?</kbd>, as appropriate) followed by a line delta
(<kbd>+</kbd> or <kbd>-</kbd> followed by a line number) to move the cursor
to the start of a line after or before the matching text.
This also has the side-effect of making the search be line-oriented instead
of character oriented; this affects the behavior of
<a href="#operators">operators</a>.
Line deltas don't work when the <a href="elvisopt.html#incsearch">incsearch</a>
option is set.
<p>You can also append the following single-letter flags after the closing
delimiter:
<pre graphic>
.------.-------------------------------------.
| FLAG | MEANING |
|------|-------------------------------------|
| v | :set <a href="elvisopt.html#autoselect">autoselect</a> |
| n | :set <a href="elvisopt.html#autoselect">noautoselect</a> |
| c | :set <a href="elvisopt.html#ignorecase">noignorecase</a> |
| i | :set <a href="elvisopt.html#ignorecase">ignorecase</a> <a href="elvisopt.html#smartcase">nosmartcase</a> |
| s | :set <a href="elvisopt.html#ignorecase">ignorecase</a> <a href="elvisopt.html#smartcase">smartcase</a> |
| w | match whole words only (add \< \>) |
| x | match whole lines only (add ^ $) |
^------^-------------------------------------^</pre>
<dt>^A
<dd><a name="^A"></a>
This command searches forward for the next instance of the word under the
cursor.
It is a shortcut for the <kbd>/\<\@\> Enter</kbd> command.
<dt>gD
<br>gd
<dd><a name="gD"></a><a name="gd"></a>
These commands search for the first appearance of the word that the cursor's
on.
<kbd>gD</kbd> starts searching from the top of the file, and is intended to
be used for finding the definition of global symbols.
<kbd>gd</kbd> starts searching from the top of the current function
(as found via the <a href="#obra">[[</a> command), and is intended to be used
for finding the definition of local symbols.
<dt>n
<br>N
<dd><a name="n"></a><a name="N"></a>
These commands repeat the previous search command,
which can be any of the commands described above.
The <kbd>n</kbd> command repeats it in the same direction as the original
search, and <kbd>N</kbd> repeats it in the opposite direction.
</dl>
<h3><a name="2.2.7"></a>2.2.7 Movement commands which search for characters</h3>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| count <a href="#pct">%</a> | Move to matching (){}[] or to a given % of file |
| count <a href="#F">F</a> key | Move leftward to a given character |
| count <a href="#f">f</a> key | Move rightward to a given character |
| count <a href="#T">T</a> key | Move leftward *almost* to a given character |
| count <a href="#t">t</a> key | Move rightward *almost* to a given character |
| count <a href="#comma">,</a> | Repeat the previous [fFtT] but in the other direction|
| count <a href="#semi">;</a> | Repeat the previous [fFtT] cmd |
^--------------^------------------------------------------------------^
</pre>
<dl>
<dt><var>count</var> %
<dd><a name="pct"></a>
This command actually performs one of two totally separate movements,
depending on whether a <var>count</var> was supplied.
With no <var>count</var>, if the cursor is on a parenthesis
character from the <a href="elvisopt.html#matchchar">matchchar</a> list, then
it moves the cursor to the opposite parenthesis.
If the cursor isn't on a parenthesis to begin with,
then Elvis will scan forward on the current line until it finds one,
and then move to its opposite.
It can also show matching preprocessor directives, if the window is in the
<a href="elvisdm.html#syntax">syntax display mode</a> for a language which
has a <a href="elvisdm.html#preprocessor">preprocessor</a>.
<p>However, if a count is supplied, then it is used as a percentage from 1 to
100, and the cursor is moved to that percentage of the way into the buffer.
For example, typing <kbd>50%</kbd> will move the cursor to the middle of the buffer.
<dt><var>count</var> F <var>key</var>
<br><var>count</var> f <var>key</var>
<dd><a name="f"></a><a name="F"></a>
These commands search for the character <var>key</var> in the current line,
starting from the cursor position.
For example, <kbd>fk</kbd> searches forward for the next "k".
<kbd>F4</kbd> searches backward for the previous "4".
If the end of line is reached without finding the character,
then the command fails.
<dt><var>count</var> T <var>key</var>
<br><var>count</var> t <var>key</var>
<dd><a name="t"></a><a name="T"></a>
These commands move almost, but not quite, to the next instance of
<var>key.</var>
The <kbd>t</kbd> and <kbd>T</kbd> commands stop one character short of
where <kbd>f</kbd> and <kbd>F</kbd> would stop, respectively.
<dt><var>count</var> ,
<br><var>count</var> ;
<dd><a name="comma"></a><a name="semi"></a>
The <kbd>;</kbd> command repeats the previous <kbd>f</kbd>, <kbd>F</kbd>,
<kbd>t</kbd>, or <kbd>T</kbd> command.
You don't need to type a <var>key</var> because Elvis automatically
uses whatever <var>key</var> you looked for last time.
The <kbd>,</kbd> command also repeats the previous <kbd>f</kbd>, <kbd>F</kbd>,
<kbd>t</kbd>, or <kbd>T</kbd> command, but in the reverse direction.
</dl>
<h3><a name="2.2.8"></a>2.2.8 Movement commands which move by words</h3>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| count <a href="#w">w</a> | Move forward "count" words |
| count <a href="#e">e</a> | Move forward to the end of the current word |
| count <a href="#b">b</a> | Move back "count" words |
| count <a href="#W">W</a> | Move forward "count" Words |
| count <a href="#E">E</a> | Move end of Word |
| count <a href="#B">B</a> | Move back Word |
^--------------^------------------------------------------------------^
</pre>
The uppercase and lowercase versions of these commands differ only in
their definition of a "word."
The uppercase commands consider a word to be any sequence of non-whitespace
characters, bound by whitespace characters or the ends of the buffer.
<p>The lowercase commands define a word as either a sequence of alphanumeric
characters, or a sequence of punctuation characters, but not a mixture of
the two; these words can be bound by whitespace, the ends of the buffer,
or by characters from the other class of lowercase word.
(I.e, an alphanumeric word can be bound by punctuation characters,
and a punctuation word can be bound by alphanumeric characters.)
The underscore character is considered to be alphanumeric.
<dl>
<dt><var>count</var> w
<br><var>count</var> W
<dd><a name="w"></a><a name="W"></a>
The <kbd>w</kbd> and <kbd>W</kbd> commands move the cursor forward to the
start of the next word.
If a count is given, the cursor will move forward <var>count</var> words.
<dt><var>count</var> e
<br><var>count</var> E
<dd><a name="e"></a><a name="E"></a>
The <kbd>e</kbd> and <kbd>E</kbd> commands move the cursor forward to the
end of the current word, or if it is already at the end of the word then
it'll move to the end of the following word.
If a count is given, the cursor will move forward <var>count</var> word ends.
<p>NOTE: These commands are often used as the targets of the <a href="#operators">operator</a>
commands, as in <kbd>dw</kbd> or <kbd>de.</kbd>
When used this way, the difference between them is that <kbd>dw</kbd> includes
any whitespace after the word, but <kbd>de</kbd> does not.
<dt><var>count</var> b
<br><var>count</var> B
<dd><a name="b"></a><a name="B"></a>
The <kbd>b</kbd> and <kbd>B</kbd> commands move the cursor backward to the
start of the current word, or if it is already at the start of the word then
it'll move to the start of the preceding word.
If a count is given, the cursor will move backward <var>count</var> word starts.
</dl>
<h3><a name="2.2.9"></a>2.2.9 Movement commands which move by sentences or sections</h3>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| count <a href="#open">(</a> | Move backward "count" sentences |
| count <a href="#close">)</a> | Move forward "count" sentences |
| count <a href="#ocur">{</a> | Move back "count" paragraphs |
| count <a href="#ccur">}</a> | Move forward "count" paragraphs |
| <a href="#obra">[ [</a> | Move back 1 section |
| <a href="#cbra">] ]</a> | Move forward 1 section |
^--------------^------------------------------------------------------^
</pre>
<dl>
<dt><var>count</var> (
<br><var>count</var> )
<dd><a name="open"></a><a name="close"></a>
These commands move backward or forward to the start of a sentence.
The start of a sentence is defined to be the first non-whitespace
character in the file, or the first non-whitespace character after
the end of a sentence.
<p>The exact definition of the end of a sentence depends on the values of
the <a href="elvisopt.html#sentenceend">sentenceend,</a>
<a href="elvisopt.html#sentencegap">sentencegap,</a>
and <a href="elvisopt.html#sentencequote">sentencequote</a> options.
The default values of those options define a sentence end to be a
period, question mark, or exclamation mark, followed by either a newline
character, or two or more space characters.
Any number of double-quote characters or closing parentheses may
appear between the punctuation and the whitespace.
<dt><var>count</var> {
<br><var>count</var> }
<dd><a name="ocur"></a><a name="ccur"></a>
These commands move backward or forward to the start of a paragraph.
The start of a paragraph is defined to be the first blank line encountered
after a non-blank line; or a line which contains a troff paragraph command
listed in the <a href="elvisopt.html#paragraphs">paragraphs</a> option's value;
or the start of a section as described below.
<dt>[[
<br>]]
<dd><a name="obra"></a><a name="cbra"></a>
These commands move backward or forward to the start of a section. The
start of a section is defined to be a troff section command listed in
the value of the <a href="elvisopt.html#sections">sections</a> option,
or a '{' character that is preceded by unindented text unless the <a
href="elvisopt.html#tweaksection">tweaksection</a> option is turned
off, in which case the '{' character must appear in column 1.
<p>Note: There are also <a href="#recbegin">[key</a> and
<a href="#recend">]key</a>
commands for recording keystrokes.
Those commands are not related to the <kbd>[[</kbd> and <kbd>]]</kbd>
movement commands.
</dl>
<h3><a name="2.2.10"></a>2.2.10 Movement/mark commands</h3>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| <a href="#m">m</a> key | Mark a line or character |
| <a href="#apost">'</a> key | Move to a marked line |
| <a href="#grave">`</a> key | Move to a marked character |
| <a href="#V">V</a> | Start marking lines for c d y < > or ! |
| <a href="#v">v</a> | Start marking characters for c d y < > or ! |
| <a href="#^V">^V</a> | Start marking a rectangle for c d y < > or ! |
| <a href="#g%">g%</a> | If any text is selected, go to opposite end |
| <a href="#g^V">g^V</a> | If a rectangle is selected, go to opposite edge |
^--------------^------------------------------------------------------^
</pre>
<dl>
<dt>m <var>key</var>
<dd><a name="m"></a>
The <kbd>m</kbd><var>key</var> command stores the current cursor position in
mark named <var>key,</var> where <var>key</var> is any letter.
The mark is not visible.
<dt>' <var>key</var>
<br>` <var>key</var>
<dd><a name="apost"></a><a name="grave"></a>
These commands move the cursor back to a position which was stored via
the <kbd>m</kbd><var>key</var> command.
The <kbd>`</kbd><var>key</var> (grave) command is a character-movement command
which positions the cursor exactly on the marked character.
The <kbd>'</kbd><var>key</var> (apostrophe) command is a line-movement command
which positions the cursor at the front of the line containing the mark.
<p>The distinction between character-movement and line-movement becomes
more significant when you're using the movement command as the target of
an <a href="#operators">operator</a> command.
For example, after an <kbd>ma</kbd> command and some cursor movement,
the command <kbd>d'a</kbd> would delete whole lines, but the command
<kbd>d`a</kbd> would delete only the text between the cursor and the "a" mark.
<dt>v
<br>V
<br>^V
<dd><a name="v"></a><a name="V"></a><a name="^V"></a>
These commands start visually selecting text for use by an
<a href="#operators">operator</a> command.
The lowercase <kbd>v</kbd> command starts selecting characters,
uppercase <kbd>V</kbd> starts selecting lines, and
<kbd>^V</kbd> starts selecting a rectangular area.
<p>The <a href="elvistip.html#clones">vim</a> clone of vi changes the meanings
of some commands while text is selected.
I didn't bother to do this with Elvis because the
<a href="elvisex.html#map">:map</a> command can be used
to achieve the same effect.
Vim users may want to try the following maps:
<pre>
:map select r g=
:map select x d
:map select U gU
:map select u gu
:map select ~ g~
:map select J :j^V^M
:map select ^] y:ta ^V^P^V^M
:map select R S
:map select o g%
:map select O g^V^V</pre>
<dt>g%
<dd><a name="g%"></a>
If you've started marking text via the
<a href="#v">v</a>, <a href="V">V</a>, or <a href="^V">^V</a> commands,
then the <kbd>g%</kbd> command will move the cursor from one end of the
selected text to the other.
You can then adjust the other end, before applying an
<a href="#operators">operator</a> to the text.
<dt>g^V
<dd><a name="g^V"></a>
If you've started marking a rectangular selection via the <a href="^V">^V</a>
command, then you can use <kbd>g^V</kbd> to jump to the opposite edge of
the selection, in the same line.
You can then adjust the opposite edge before applying an
<a href="#operators">operator</a> to the text.
</dl>
<h3><a name="2.2.11"></a>2.2.11 Scrolling commands</h3>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| <a href="#^F">^F</a> | Move toward the bottom of the file by 1 screen full |
| <a href="#^B">^B</a> | Move toward the top of the file by 1 screen full |
| <a href="#z">z</a> key | Scroll current line to window's +top -bottom .middle |
| count <a href="#^D">^D</a> | Scroll forward "count" lines (default 1/2 screen) |
| count <a href="#^E">^E</a> | Scroll forward "count" lines (default 1 line) |
| count <a href="#^U">^U</a> | Scroll backward "count" lines (default 1/2 screen) |
| count <a href="#^Y">^Y</a> | Scroll backward "count" lines (default 1 line) |
^--------------^------------------------------------------------------^
</pre>
<dl>
<dt>^F
<dd><a name="^F"></a>
This command moves forward one screen.
Specifically, it locates the line at the bottom of the window and moves
it to the top of the window.
This means that for a 24-row window, ^F will generally move forward 22 lines.
The cursor is moved if necessary to keep it on the screen.
<dt>^B
<dd><a name="^B"></a>
This command moves backward one screen, by moving the line at the top of the
window to the bottom.
It is the opposite of the ^F command.
<dt>z <var>key</var>
<dd><a name="z"></a>
This command scrolls to bring the current line to either the
top (for <kbd>z+</kbd>)
middle (for <kbd>z.</kbd>)
or bottom (for <kbd>z-</kbd>) of the window.
You can also precede this command with a line number, in which case the
cursor is moved to that line before the scrolling takes place; e.g.,
<code>98z+</code> will move the cursor to line 98 and then scroll as necessary
to bring 98 to the top of the window.
<p>Elvis also supports <kbd>zH</kbd>, <kbd>zM</kbd>, and <kbd>zL</kbd>
as synonyms for those commands.
These may be easier to remember, because they are somewhat analogous to
the <a href="#H">H</a>, <a href="#M">M</a>, and <a href="#L">L</a> commands.
In addition, <kbd>zz</kbd> is an easy-to-type synonym for scrolling a
line to middle of the window.
<dt><var>count</var> ^D
<br><var>count</var> ^E
<dd><a name="^D"></a><a name="^E"></a>
These commands scroll the window forward by <var>count</var> lines.
If no <var>count</var> is given, then <kbd>^E</kbd> defaults to 1 line,
and <kbd>^D</kbd> defaults to the value of the <a href="#scroll">scroll</a> option.
Supplying a <var>count</var> to the <kbd>^D</kbd> option has the side-effect of setting
the scroll option to <var>count.</var>
<dt><var>count</var> ^U
<br><var>count</var> ^Y
<dd><a name="^U"></a><a name="^Y"></a>
These commands scroll the window backward by <var>count</var> lines.
If no <var>count</var> is given, then <kbd>^Y</kbd> defaults to 1 line,
and <kbd>^U</kbd> defaults
to the value of the <a href="#scroll">scroll</a> option.
Supplying a <var>count</var> to the <kbd>^U</kbd> option has the side-effect of setting
the scroll option to <var>count.</var>
</dl>
<h3><a name="2.2.12"></a><a name="^W"></a>2.2.12 Window commands</h3>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| <a href="#^Ws">^W s</a> | Split current window |
| <a href="#^W]">^W ]</a> | Split window, then look up tag at cursor |
| <a href="#^Wn">^W n</a> | Split window, and create a new buffer |
| <a href="#^Wq">^W q</a> | Save buffer & close window, like ZZ |
| <a href="#^Wc">^W c</a> | Hide buffer & close window |
| <a href="#^Wo">^W o</a> | Close all windows except this one & hide their bufs |
| <a href="#^Wd">^W d</a> | Toggle the display mode |
| <a href="#^WS">^W S</a> | Toggle the sidescroll option |
| <a href="#^Wj">^W j</a> | Move down to next window |
| <a href="#^Wk">^W k</a> | Move up to previous window |
| count <a href="#^W^W">^W ^W</a> | Toggle between the two most recently used windows |
| count <a href="#^Ww">^W w</a> | Move to next window, or to the "count" window |
^--------------^------------------------------------------------------^
</pre>
<dl>
<dt>^W s
<dd><a name="^Ws"></a>
This creates a new window, showing the same buffer as the current window.
It is equivalent to the ex <a href="elvisex.html#split">:split</a> command
with no arguments.
<dt>^W ]
<dd><a name="^W]"></a>
This performs tag lookup on the word at the cursor, and then creates a new
window to show the tag definition. It is similar to the ex
<a href="elvisex.html#stag">:stag</a> command.
<dt>^W n
<dd><a name="^Wn"></a>
This creates a new buffer, and then creates a new window to show that buffer.
It is similar to the ex <a href="elvisex.html#snew">:snew</a> command.
<dt>^W q
<dd><a name="^Wq"></a>
This saves the buffer if it has changed, and then closes the window.
It is identical to the visual <a href="elvisvi.html#Z">ZZ</a> command,
and similar to the ex <a href="elvisex.html#xit">:xit</a> command.
<dt>^W c
<dd><a name="^Wc"></a>
This closes the window, but it neither saves nor discards the current buffer.
The buffer continues to exist.
This command is like the ex <a href="elvisex.html#close">:close</a> command.
<dt>^W o
<dd><a name="^Wo"></a>
This makes the current window be the only one, by closing all of the other
windows.
The edit buffers in those other windows are hidden.
This is like running <a href="elvisex.html#close">:close</a> in all the
other windows.
<dt>^W d
<dd><a name="^Wd"></a>
This toggles the windows display mode between two different modes.
If the buffer's <a href="elvisopt.html#bufdisplay">bufdisplay</a> option
is set to "html", "man", or "tex", then it will toggle between that mode
and the syntax coloring mode.
If <code>bufdisplay</code> is set to a syntax-coloring mode or "hex" then
it toggles between that mode and "normal".
If <code>bufdisplay</code> is "normal", then this command toggles between
that mode and the "hex" mode.
<dt>^W S
<dd><a name="^WS"></a>
This toggles the <a href="elvisopt.html#wrap">wrap</a> option off or on,
causing sideways scrolling to be alternately disabled and enabled.
<dt>^W j
<br>^W k
<br>^W ^W
<br><var>count</var> ^W w
<dd><a name="^Wj"></a><a name="^Wk"></a><a name="^W^W"></a><a name="^Ww"></a>
These commands make other windows be current.
This is the only possible way to switch windows for some user interfaces
such as the termcap interface.
</dl>
<p>NOTE: In addition to the commands shown here, some user interfaces may
support extensions to these commands.
For example, the termcap interface uses
<kbd>^W+</kbd> to increase the size of the current window,
<kbd>^W-</kbd> to reduce the size of the current window, and
<kbd>^W\</kbd> to make the current window as large as possible.
See the <a href="elvisgui.html">User Interfaces chapter</a>.
<h3><a name="2.2.13"></a>2.2.13 Other commands</h3>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| <a href="#quote">"</a> key | Select which cut buffer to use next |
| <a href="#at">@</a> key | Execute the contents of a cut-buffer as VI commands |
| <a href="#recbegin">[</a> key | Start recording keystrokes into a cut-buffer |
| <a href="#recend">]</a> key | Stop recording keystrokes into a cut-buffer |
| <a href="#colon">:</a> text | Run single EX cmd |
| <a href="#Q">Q</a> | Quit to EX mode |
| <a href="#K">K</a> | Run keywordprg on the word at the cursor |
| <a href="#Z">Z Z</a> | Save the file & exit |
| <a href="#^Z">^Z</a> | Either suspend Elvis, or fork a shell |
| <a href="#^G">^G</a> | Show file status, and the current line # |
| <a href="#^L">^L</a> | Redraw the screen |
| <a href="#*">*</a> | Go to the next error in the errlist |
| <a href="#^I">^I</a> | (Tab) Go to next HTML link, or toggle folding |
| <a href="#g^I">g^I</a> | (g-Tab) Go to previous HTML link |
| <a href="#^T">^T</a> | Return to source of previous :tag or ^] command. |
| <a href="#^cbra">^]</a> | If the cursor is on a tag name, go to that tag |
| <a href="#^^">^^</a> | Switch to the previous file, like ":e #" |
| count <a href="#hash">#</a> key | Increment a number |
| count <a href="#amp">&</a> | Repeat the previous ":s//" command here |
| count <a href="#gs">gs</a> | Find next misspelled word, maybe after fixing current|
| <a href="#gS">gS</a> | Move to end of spelling word |
^--------------^------------------------------------------------------^
</pre>
<dl>
<dt>" <var>key</var>
<dd><a name="quote"></a>
This command determines which cut buffer the next command will use.
If the next command doesn't involve a cut buffer, then this command has
no effect.
If you don't use this command, then the following command will use the
anonymous cut buffer.
<dt>@ <var>key</var>
<dd><a name="at"></a>
The <kbd>@</kbd> command executes the contents of a cut buffer as a
series of vi command keystrokes.
The key after the <kbd>@</kbd> is the name of the cut buffer
to be executed.
<dt>[ <var>key</var>
<br>] <var>key</var>
<dd><a name="recbegin"></a><a name="recend"></a>
These commands are used for recording keystrokes into a cut-buffer.
The <var>key</var> is the name of the cut buffer; it must be a letter.
Later, you can replay the keystrokes via the <kbd>@</kbd><var>key</var>
command.
<p>Note: There are also <a href="#obra">[[</a> and <a href="#cbra">]]</a>
commands for moving the cursor to the start of a section.
Those movement commands are unrelated to these <kbd>[</kbd><var>key</var>
and <kbd>]</kbd><var>key</var> keystroke recording commands.
<dt>:
<br>Q
<dd><a name="colon"></a><a name="Q"></a>
This <kbd>:</kbd> command allows you to enter a single ex command,
and then immediately return to visual command.
The <kbd>Q</kbd> command is similar,
except that it causes you to remain in ex mode
until you give the ex <a href="elvisex.html#visual">:vi</a> command.
<dt>K
<dd><a name="K"></a>
This command executes the program named in the
<a href="elvisopt.html#keywordprg">keywordprg</a> option,
passing it the word at the cursor.
This is intended to provide an easy way to run on-line manuals and the like.
<dt>ZZ
<dd><a name="Z"></a>
The <kbd>ZZ</kbd> command writes the current file if it has changed,
and then exits.
It is equivalent to the ex <a href="elvisex.html#xit">:xit</a> command.
<dt>^Z
<dd><a name="^Z"></a>
This command will either suspend Elvis, or fork a shell program.
Either way, you'll get a shell prompt.
<kbd>^Z</kbd> is equivalent to the <a href="elvisex.html#stop">:stop</a>
ex command.
<dt>^G
<dd><a name="^G"></a>
The <kbd>^G</kbd> command displays the status of the current file.
It is equivalent to the ex <a href="elvisex.html#file">:file</a> command
with no arguments.
<dt>^L
<dd><a name="^L"></a>
The <kbd>^L</kbd> command causes the current window to be redrawn from scratch.
This is handy when another program or line noise changes the screen in a
way that Elvis can't detect & correct automatically.
<dt>*
<dd><a name="*"></a>
The <kbd>*</kbd> command moves the cursor to the next error reported by
the compiler.
It is equivalent to the ex <a href="#errlist">:errlist</a> command.
<dt>^I
<dd><a name="^I"></a>
The <kbd>^I</kbd> command (the <kbd>Tab</kbd> key) moves the cursor forward
to the next hypertext link, if you're in the "html" display mode.
In the "normal" and "syntax" display modes, it will
unfold or refold text, like the <a href="elvisex.html#unfold">:unfold</a> and
<a href="elvisex.html#fold">:fold</a> commands.
<dt>g^I
<dd><a name="g^I"></a>
The <kbd>g^I</kbd> command (a <kbd>g</kbd> key followed by a <kbd>Tab</kbd> key)
moves the cursor backward to the previous hypertext link, if you're in the
"html" display mode.
<p><strong>Note:</strong> Most user interfaces try to map
<kbd><Shift-Tab></kbd> to this command.
This is difficult for the <a href="elvisgui.html#termcap">termcap</a> interface
because not all terminals support it.
Even if the terminal supports it, the termcap/terminfo database might not
describe it correctly.
<dt>^]
<br>^T
<dd><a name="^T"></a><a name="^cbra"></a>
The <kbd>^]</kbd> command performs tag lookup on the word
at the cursor position, and
moves the cursor to the file/line where the tag is defined.
It resembles the ex <a href="elvisex.html#tag">:tag</a> command.
The <kbd>^T</kbd> command returns the cursor to the previous position,
like <a href="elvisex.html#pop">:pop</a>.
<dt>^^
<dd><a name="^^"></a>
After you've switched edit buffers in a window, the <kbd>^^</kbd>
(Control-Caret) command
switches back to the previous buffer, and moves the cursor to its previous
position within that buffer.
It is like the ex <a href="elvisex.html#edit">:e#</a> command.
<dt><var>count</var> # <var>key</var>
<dd><a name="hash"></a>
This command allows you add or subtract <var>count</var> to the number at
the cursor.
If the cursor isn't on a word that looks like a number, then the command fails.
If no <var>count</var> is given, then 1 is assumed.
If the <var>key</var> is "-" then <var>count</var> is subtracted from the
number.
If the <var>key</var> is "=" then the word is changed to <var>count</var>.
Any other <var>key</var> will add <var>count</var> to the number.
<dt><var>count</var> &
<dd><a name="amp"></a>
Repeat the previous <a href="elvisex.html#substitute">:s/re/new/</a> command on the
current line.
If <var>count</var> is given, then also apply it to each of the
<var>count-1</var> following lines as well.
<dt><var>count</var> gs
<dd><a name="gs"></a>
Search forward for the next misspelled word.
<p>If given a count, then <em>before moving</em>,
try to replace the current misspelled
word with the <var>count</var>'th suggested spelling.
This only works if the <a href="elvisopt.html#show">show</a> option
contains a "spell" keyword, and
the cursor is on a misspelled word with good suggestions.
For more information about the spell checker,
see the spelling section in the
"<a href="elvistip.html#SPELL">Tips</a>" chapter.
<dt>gS
<dd><a name="gS"></a>
Move to the end of the current misspelled word.
This is handy because you can use
<a href="#c">c</a><kbd>gS</kbd><var>text</var><kbd><Esc></kbd>
to correct a misspelled word.
The difference between <kbd>gS</kbd> and <a href="#e">e</a> is that
<kbd>gS</kbd> uses the spell checker's definition of a "word", which
allows apostrophes between letters.
</dl>
<h2><a name="index"></a><a name="INDEX"></a>2.3 Visual Commands, sorted by their ASCII code</h2>
<pre graphic>.--------------.------------------------------------------------------.
| COMMAND | DESCRIPTION |
|--------------|------------------------------------------------------|
| NUL | (undefined) |
| <a href="#^A">^A</a> | Search for next occurrence of word at cursor |
| <a href="#^B">^B</a> | Move toward the top of the file by 1 screen full |
| ^C | (undefined; may abort a time-consuming command) |
| count <a href="#^D">^D</a> | Scroll forward "count" lines (default 1/2 screen) |
| count <a href="#^E">^E</a> | Scroll forward "count" lines (default 1 line) |
| <a href="#^F">^F</a> | Move toward the bottom of the file by 1 screen full |
| <a href="#^G">^G</a> | Show file status, and the current line # |
| count <a href="#^H">^H</a> | Move left |
| <a href="#^I">^I</a> | (Tab) Go to next HTML link, or toggle folding |
| count <a href="#^J">^J</a> | Move down |
| ^K | (undefined) |
| <a href="#^L">^L</a> | Redraw the screen |
| count <a href="#^M">^M</a> | Move to the front of the next line |
| count <a href="#^N">^N</a> | Move down |
| ^O | ignored, to simplify implementation of "visual" map |
| count <a href="#^P">^P</a> | Move up |
| ^Q | (undefined; may resume stopped output) |
| count <a href="#^R">^R</a> | Redo commands which were undone by the u command |
| ^S | (undefined; may stop output) |
| <a href="#^T">^T</a> | Return to source of previous :tag or ^] command. |
| count <a href="#^U">^U</a> | Scroll backward "count" lines (default 1/2 screen) |
| <a href="#^V">^V</a> | Start marking a rectangle for c d y < > or ! |
| count <a href="#^W^W">^W ^W</a> | Move to next window, or to the "count" window |
| <a href="#^WS">^W S</a> | Toggle the sidescroll option |
| <a href="#^W]">^W ]</a> | Split window, then look up tag at cursor |
| <a href="#^Wc">^W c</a> | Hide buffer & close window |
| <a href="#^Wd">^W d</a> | Toggle the display mode |
| <a href="#^Wj">^W j</a> | Move down to next window |
| <a href="#^Wk">^W k</a> | Move up to previous window |
| <a href="#^Wn">^W n</a> | Split window, and create a new buffer |
| <a href="#^Wq">^W q</a> | Save buffer & close window, like ZZ |
| <a href="#^Ws">^W s</a> | Split current window |
| count <a href="#^X">^X</a> | Move to column "count" (defaulting to the right edge)|
| count <a href="#^Y">^Y</a> | Scroll backward "count" lines (default 1 line) |
| <a href="#^Z">^Z</a> | Either suspend Elvis, or fork a shell |
| ^[ | (Escape) Cancels a partially-entered command |
| ^\ | (undefined; may cause core dump) |
| <a href="#^cbra">^]</a> | If the cursor is on a tag name, go to that tag |
| <a href="#^^">^^</a> | Switch to the previous file, like ":e #" |
| ^_ | (undefined) |
| count <a href="#l">Space</a> | Move right |
| <a href="#bang">!</a> mv | Run selected lines thru an external filter program |
| <a href="#quote">"</a> key | Select which cut buffer to use next |
| count <a href="#hash">#</a> key | Increment a number |
| <a href="#dollar">$</a> | Move to the rear of the current line |
| count <a href="#pct">%</a> | Move to matching (){}[] or to a given % of file |
| count <a href="#amp">&</a> | Repeat the previous ":s//" command here |
| <a href="#apost">'</a> key | Move to a marked line |
| count <a href="#open">(</a> | Move backward "count" sentences |
| count <a href="#close">)</a> | Move forward "count" sentences |
| <a href="#*">*</a> | Go to the next error in the errlist |
| count <a href="#+">+</a> | Move to the front of the next line |
| count <a href="#comma">,</a> | Repeat the previous [fFtT] but in the other direction|
| count <a href="#-">-</a> | Move to the front of the preceding line |
| count <a href="#stop">.</a> | Repeat the previous "edit" command |
| <a href="#slash">/</a> text | Search forward for a given regular expression |
| <a href="#0">0</a> | If not part of count, move to 1st char of this line |
| 1 | Part of a count argument |
| 2 | Part of a count argument |
| 3 | Part of a count argument |
| 4 | Part of a count argument |
| 5 | Part of a count argument |
| 6 | Part of a count argument |
| 7 | Part of a count argument |
| 8 | Part of a count argument |
| 9 | Part of a count argument |
| <a href="#colon">:</a> text | Run single EX cmd |
| count <a href="#semi">;</a> | Repeat the previous [fFtT] cmd |
| <a href="#lt"><</a> mv | Shift text left |
| <a href="#=">=</a> mv | Reformat |
| <a href="#gt">></a> mv | Shift text right |
| <a href="#quest">?</a> text | Search backward for a given regular expression |
| <a href="#at">@</a> key | Execute the contents of a cut-buffer as VI commands |
| count <a href="#A">A</a> inp | Append at end of the line |
| count <a href="#B">B</a> | Move back Word |
| <a href="#C">C</a> inp | Change text from the cursor to the end of the line |
| <a href="#D">D</a> | Delete text from the cursor to the end of the line |
| count <a href="#E">E</a> | Move end of Word |
| count <a href="#F">F</a> key | Move leftward to a given character |
| count <a href="#G">G</a> | Move to line #"count" (default is the bottom line) |
| count <a href="#H">H</a> | Move to home row (the line at the top of the screen) |
| count <a href="#I">I</a> inp | Insert at the front of the line (after indents) |
| count <a href="#J">J</a> | Join lines, to form one big line |
| <a href="#K">K</a> | Run keywordprg on the word at the cursor |
| count <a href="#L">L</a> | Move to last row (i.e., line at bottom of window) |
| <a href="#M">M</a> | Move to middle row |
| <a href="#N">N</a> | Repeat previous search, but in the opposite direction|
| count <a href="#O">O</a> inp | Open up a new line above the current line |
| <a href="#P">P</a> | Paste text before the cursor |
| <a href="#Q">Q</a> | Quit to EX mode |
| <a href="#R">R</a> inp | Overtype |
| count <a href="#S">S</a> inp | Change lines, like "count" cc |
| count <a href="#T">T</a> key | Move leftward *almost* to a given character |
| <a href="#U">U</a> | Undo all recent changes to the current line |
| <a href="#V">V</a> | Start marking lines for c d y < > or ! |
| count <a href="#W">W</a> | Move forward "count" Words |
| count <a href="#X">X</a> | Delete the character(s) to the left of the cursor |
| count <a href="#Y">Y</a> | Yank text line(s) (copy them into a cut buffer) |
| <a href="#Z">Z Z</a> | Save the file & exit |
| <a href="#obra">[ [</a> | Move back 1 section |
| <a href="#recbegin">[</a> key | Start recording keystrokes into a cut-buffer |
| \ | (undefined) |
| <a href="#cbra">] ]</a> | Move forward 1 section |
| <a href="#recend">]</a> key | Stop recording keystrokes into a cut-buffer |
| <a href="#^">^</a> | Move to the front of the current line (after indent) |
| count <a href="#_">_</a> | (the underscore character) Move to the current line |
| <a href="#grave">`</a> key | Move to a marked character |
| count <a href="#a">a</a> inp | Insert text after the cursor |
| count <a href="#b">b</a> | Move back "count" words |
| <a href="#c">c</a> mv | Change text |
| <a href="#d">d</a> mv | Delete text |
| count <a href="#e">e</a> | Move forward to the end of the current word |
| count <a href="#f">f</a> key | Move rightward to a given character |
| g | (undefined) |
| <a href="#g^I">g^I</a> | (g-Tab) Go to previous HTML link |
| <a name="g"></a> <a href="#g^V">g^V</a> | If a rectangle is selected, go to opposite edge |
| <a href="#gdollar">g$</a> | Move to end of current row |
| <a href="#g%">g%</a> | If any text is selected, go to opposite end |
| <a href="#g0">g0</a> | Move to start of current row, before indent |
| <a href="#g=">g=</a> key mv | Convert text to an equal number of <var>key</var> characters |
| <a href="#gD">gD</a> | Go to global definition of word at cursor |
| count <a href="#gI">gI</a> inp | Input at start of line, before indent |
| count <a href="#gJ">gJ</a> | Join lines without adding whitespace |
| <a href="#gS">gS</a> | Move to end of spelling word |
| <a href="#gU">gU</a> mv | Convert text to uppercase |
| <a href="#g^">g^</a> | Move to start of current row, after indent |
| <a href="#gd">gd</a> | Go to local definition of word at cursor |
| count <a href="#gh">gh</a> | Move left, skipping invisible characters |
| count <a href="#gj">gj</a> | Move down 1 row (useful when lines wrap) |
| count <a href="#gk">gk</a> | Move up 1 row (useful when lines wrap) |
| count <a href="#gl">gl</a> | Move right, skipping invisible characters |
| count <a href="#gs">gs</a> | Find next misspelled word, maybe after fixing current|
| <a href="#gu">gu</a> mv | Convert text to lowercase |
| <a href="#g~">g~</a> mv | Toggle text between uppercase & lowercase |
| count <a href="#h">h</a> | Move left |
| count <a href="#i">i</a> inp | Insert text at the cursor |
| count <a href="#j">j</a> | Move down |
| count <a href="#k">k</a> | Move up |
| count <a href="#l">l</a> | Move right |
| <a href="#m">m</a> key | Mark a line or character |
| <a href="#n">n</a> | Repeat the previous search |
| count <a href="#o">o</a> inp | Open a new line below the current line |
| <a href="#p">p</a> | Paste text after the cursor |
| q | (undefined) |
| count <a href="#r">r</a> key | Replace "count" chars by a given character |
| count <a href="#s">s</a> inp | Replace characters, like "count" cl |
| count <a href="#t">t</a> key | Move rightward *almost* to a given character |
| count <a href="#u">u</a> | Undo the previous edit command |
| <a href="#v">v</a> | Start marking characters for c d y < > or ! |
| count <a href="#w">w</a> | Move forward "count" words |
| count <a href="#x">x</a> | Delete the character that the cursor's on |
| <a href="#y">y</a> mv | Yank text (copy it into a cut buffer) |
| <a href="#z">z</a> key | Scroll current line to window's +top -bottom .middle |
| count <a href="#ocur">{</a> | Move back "count" paragraphs |
| count <a href="#bar">|</a> | Move to column "count" (defaulting to column 1) |
| count <a href="#ccur">}</a> | Move forward "count" paragraphs |
| count <a href="#~">~</a> | Switch a character between uppercase & lowercase |
| DEL | (undefined) |
^--------------^------------------------------------------------------^
</pre>
</body></html>
|