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
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
|
.\"
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
.\" permission to reproduce portions of its copyrighted documentation.
.\" Original documentation from The Open Group can be obtained online at
.\" http://www.opengroup.org/bookstore/.
.\"
.\" The Institute of Electrical and Electronics Engineers and The Open
.\" Group, have given us permission to reprint portions of their
.\" documentation.
.\"
.\" In the following statement, the phrase ``this text'' refers to portions
.\" of the system documentation.
.\"
.\" Portions of this text are reprinted and reproduced in electronic form
.\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
.\" Standard for Information Technology -- Portable Operating System
.\" Interface (POSIX), The Open Group Base Specifications Issue 6,
.\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
.\" Engineers, Inc and The Open Group. In the event of any discrepancy
.\" between these versions and the original IEEE and The Open Group
.\" Standard, the original IEEE and The Open Group Standard is the referee
.\" document. The original Standard can be obtained online at
.\" http://www.opengroup.org/unix/online.html.
.\"
.\" This notice shall appear on any product containing this material.
.\"
.\" The contents of this file are subject to the terms of the
.\" Common Development and Distribution License (the "License").
.\" You may not use this file except in compliance with the License.
.\"
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
.\" or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions
.\" and limitations under the License.
.\"
.\" When distributing Covered Code, include this CDDL HEADER in each
.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
.\" If applicable, add the following below this CDDL HEADER, with the
.\" fields enclosed by brackets "[]" replaced with your own identifying
.\" information: Portions Copyright [yyyy] [name of copyright owner]
.\"
.\"
.\" Copyright 1989 AT&T
.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
.\"
.TH VI 1HAS "May 16, 2007"
.SH NAME
vi, view, vedit \- screen-oriented (visual) display editor based on ex
.SH SYNOPSIS
.LP
.nf
\fB/usr/bin/vi\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]] [\fB-S\fR]
[\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
[\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
.fi
.LP
.nf
\fB/usr/bin/view\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]] [\fB-S\fR]
[\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
[\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
.fi
.LP
.nf
\fB/usr/bin/vedit\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]] [\fB-S\fR]
[\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
[\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
.fi
.LP
.nf
\fB/usr/xpg4/bin/vi\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]]
[\fB-S\fR] [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
[\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
.fi
.LP
.nf
\fB/usr/xpg4/bin/view\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]]
[\fB-S\fR] [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
[\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
.fi
.LP
.nf
\fB/usr/xpg4/bin/vedit\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]]
[\fB-S\fR] [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
[\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
.fi
.LP
.nf
\fB/usr/xpg6/bin/vi\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]]
[\fB-S\fR] [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
[\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
.fi
.LP
.nf
\fB/usr/xpg6/bin/view\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]]
[\fB-S\fR] [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
[\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
.fi
.LP
.nf
\fB/usr/xpg6/bin/vedit\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]]
[\fB-S\fR] [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
[\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
.fi
.SH DESCRIPTION
.LP
The \fBvi\fR (visual) utility is a display-oriented text editor based on an
underlying line editor \fBex\fR. It is possible to use the command mode of
\fBex\fR from within \fBvi\fR and to use the command mode of \fBvi\fR from
within \fBex\fR. The visual commands are described on this manual page; how to
set options (like automatically numbering lines and automatically starting a
new output line when you type carriage return) and all \fBex\fR line editor
commands are described on the \fBex\fR(1) manual page.
.sp
.LP
When using \fBvi\fR, changes you make to the file are reflected in what you see
on your terminal screen. The position of the cursor on the screen indicates the
position within the file.
.sp
.LP
The \fBview\fR invocation is the same as \fBvi\fR except that the
\fBreadonly\fR flag is set.
.sp
.LP
The \fBvedit\fR invocation is intended for beginners. It is the same as
\fBvi\fR except that the \fBreport\fR flag is set to \fB1\fR, the
\fBshowmode\fR and \fBnovice\fR flags are set, and \fBmagic\fR is turned off.
These defaults make it easier to learn how to use \fBvi\fR.
.SH OPTIONS
.LP
The following options are supported:
.SS "Invocation Options"
.LP
The following invocation options are interpreted by \fBvi\fR (previously
documented options are discussed under NOTES):
.sp
.ne 2
.na
\fB\fB\(mi\fR | \fB-s\fR\fR
.ad
.RS 25n
Suppresses all interactive user feedback. This is useful when processing editor
scripts.
.RE
.sp
.ne 2
.na
\fB\fB-C\fR\fR
.ad
.RS 25n
Encryption option. Same as the \fB-x\fR option, except that \fBvi\fR simulates
the \fBC\fR command of \fBex\fR. The \fBC\fR command is like the \fBX\fR
command of \fBex\fR, except that all text read in is assumed to have been
encrypted.
.RE
.sp
.ne 2
.na
\fB\fB-l\fR\fR
.ad
.RS 25n
Sets up for editing \fBLISP\fR programs.
.RE
.sp
.ne 2
.na
\fB\fB-L\fR\fR
.ad
.RS 25n
Lists the name of all files saved as the result of an editor or system crash.
.RE
.sp
.ne 2
.na
\fB\fB-r\fR \fIfilename\fR\fR
.ad
.RS 25n
Edits \fIfilename\fR after an editor or system crash. (Recovers the version of
\fIfilename\fR that was in the buffer when the crash occurred.)
.RE
.sp
.ne 2
.na
\fB\fB-R\fR\fR
.ad
.RS 25n
\fBReadonly\fR mode. The \fBreadonly\fR flag is set, preventing accidental
overwriting of the file.
.RE
.sp
.ne 2
.na
\fB\fB-S\fR\fR
.ad
.RS 25n
This option is used in conjunction with the \fB-t\fR \fItag\fR option to tell
\fBvi\fR that the tags file can not be sorted and that, if the binary search
(which relies on a sorted tags file) for \fItag\fR fails to find it, the much
slower linear search should also be done. Since the linear search is slow,
users of large tags files should ensure that the tags files are sorted rather
than use this flag. Creation of tags files normally produces sorted tags files.
See \fBctags\fR(1) for more information on tags files.
.RE
.sp
.ne 2
.na
\fB\fB-t\fR \fItag\fR\fR
.ad
.RS 25n
Edits the file containing \fItag\fR and position the editor at its definition.
It is an error to specify more than one \fB-t\fR option.
.RE
.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.RS 25n
Starts up in display editing state, using \fBvi\fR. You can achieve the same
effect by typing the \fBvi\fR command itself.
.RE
.sp
.ne 2
.na
\fB\fB-V\fR\fR
.ad
.RS 25n
Verbose. When \fBex\fR commands are read by means of standard input, the input
is echoed to standard error. This can be useful when processing \fBex\fR
commands within shell scripts.
.RE
.sp
.ne 2
.na
\fB\fB-w\fR\fIn\fR\fR
.ad
.RS 25n
Sets the default window size to \fIn\fR. This is useful when using the editor
over a slow speed line.
.RE
.sp
.ne 2
.na
\fB\fB-x\fR\fR
.ad
.RS 25n
Encryption option. When used, \fBvi\fR simulates the \fBX\fR command of
\fBex\fR and prompts the user for a key. This key is used to encrypt and
decrypt text using the algorithm of the \fBcrypt\fR command. The \fBX\fR
command makes an educated guess to determine whether text read in is encrypted
or not. The temporary buffer file is encrypted also, using a transformed
version of the key typed in for the \fB-x\fR option. If an empty encryption
key is entered (that is, if the return key is pressed right after the prompt),
the file is not encrypted. This is a good way to decrypt a file erroneously
encrypted with a mistyped encryption key, such as a backspace or undo key.
.RE
.sp
.ne 2
.na
\fB\fB-\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR\fR
.ad
.RS 25n
Begins editing by executing the specified editor \fIcommand\fR (usually a
search or positioning command).
.RE
.SS "/usr/xpg4/bin/vi and /usr/xpg6/bin/vi"
.LP
If both the \fB-t\fR \fItag\fR and the \fB-c\fR \fIcommand\fR options are
given, the \fB-t\fR \fItag\fR option is processed first. That is, the file
containing \fItag\fR is selected by \fB-t\fR and then the command is executed.
.SH OPERANDS
.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIfilename\fR\fR
.ad
.RS 12n
A file to be edited.
.RE
.SH COMMAND SUMMARY
.LP
The \fBvi\fR command modes are summarized in this section.
.SS "vi Modes"
.ne 2
.na
\fBCommand\fR
.ad
.RS 13n
Normal and initial mode. Other modes return to command mode upon completion.
\fIESC\fR (escape) is used to cancel a partial command.
.RE
.sp
.ne 2
.na
\fBInput\fR
.ad
.RS 13n
Entered by setting any of the following options:
.sp
.in +2
.nf
a A i I o O c C s S R
.fi
.in -2
.sp
Arbitrary text can then be entered. Input mode is normally terminated with the
\fIESC\fR character, or, abnormally, with an interrupt.
.RE
.sp
.ne 2
.na
\fBLast line\fR
.ad
.RS 13n
Reading input for \fB: / ?\fR or \fB!\fR. Terminate by typing a carriage
return. An interrupt cancels termination.
.RE
.SS "Sample Commands"
.LP
In the descriptions, \fICR\fR stands for carriage return and \fIESC\fR stands
for the escape key.
.sp
.ne 2
.na
\fB\(<-, \(->\fR
.ad
.br
.na
\fBdown-arrow\fR
.ad
.br
.na
\fBup-arrow\fR
.ad
.RS 14n
arrow keys move the cursor
.RE
.sp
.ne 2
.na
\fBh j k l\fR
.ad
.RS 14n
same as arrow keys
.RE
.sp
.ne 2
.na
\fBi\fItext\fR\fIESC\fR\fR
.ad
.RS 14n
insert \fItext\fR
.RE
.sp
.ne 2
.na
\fBcw\fInew\fR\fIESC\fR\fR
.ad
.RS 14n
change word to \fInew\fR
.RE
.sp
.ne 2
.na
\fBea\fIs\fR\fIESC\fR\fR
.ad
.RS 14n
pluralize word (end of word; append \fBs\fR; escape from input state)
.RE
.sp
.ne 2
.na
\fBx\fR
.ad
.RS 14n
delete a character
.RE
.sp
.ne 2
.na
\fBdw\fR
.ad
.RS 14n
delete a word
.RE
.sp
.ne 2
.na
\fBdd\fR
.ad
.RS 14n
delete a line
.RE
.sp
.ne 2
.na
\fB3dd\fR
.ad
.RS 14n
delete 3 lines
.RE
.sp
.ne 2
.na
\fBu\fR
.ad
.RS 14n
undo previous change
.RE
.sp
.ne 2
.na
\fBZZ\fR
.ad
.RS 14n
exit \fBvi\fR, saving changes
.RE
.sp
.ne 2
.na
\fB:q!\fICR\fR\fR
.ad
.RS 14n
quit, discarding changes
.RE
.sp
.ne 2
.na
\fB/\fItext\fR\fICR\fR\fR
.ad
.RS 14n
search for \fItext\fR
.RE
.sp
.ne 2
.na
\fB^U ^D\fR
.ad
.RS 14n
scroll up or down
.RE
.sp
.ne 2
.na
\fB:\fIcmd\fR\fICR\fR\fR
.ad
.RS 14n
any \fBex\fR or \fBed\fR command
.RE
.SS "Counts Before vi Commands"
.LP
Numbers can be typed as a prefix to some commands. They are interpreted in one
of these ways:
.sp
.ne 2
.na
\fBline/column number\fR
.ad
.RS 22n
z G |
.RE
.sp
.ne 2
.na
\fBscroll amount\fR
.ad
.RS 22n
^D ^U
.RE
.sp
.ne 2
.na
\fBrepeat effect\fR
.ad
.RS 22n
most of the rest
.RE
.SS "Interrupting, Canceling"
.ne 2
.na
\fB\fIESC\fR\fR
.ad
.RS 7n
end insert or incomplete command
.RE
.sp
.ne 2
.na
\fB\fIDEL\fR\fR
.ad
.RS 7n
(delete or rubout) interrupts
.RE
.SS "File Manipulation"
.ne 2
.na
\fBZZ\fR
.ad
.RS 15n
if file modified, write and exit; otherwise, exit
.RE
.sp
.ne 2
.na
\fB:w\fICR\fR\fR
.ad
.RS 15n
write back changes
.RE
.sp
.ne 2
.na
\fB:w!\fICR\fR\fR
.ad
.RS 15n
forced write, if permission originally not valid
.RE
.sp
.ne 2
.na
\fB:q\fICR\fR\fR
.ad
.RS 15n
quit
.RE
.sp
.ne 2
.na
\fB:q!\fICR\fR\fR
.ad
.RS 15n
quit, discard changes
.RE
.sp
.ne 2
.na
\fB:e \fIname\fR\fICR\fR\fR
.ad
.RS 15n
edit file \fIname\fR
.RE
.sp
.ne 2
.na
\fB:e!\fICR\fR\fR
.ad
.RS 15n
reedit, discard changes
.RE
.sp
.ne 2
.na
\fB:e + \fIname\fR\fICR\fR\fR
.ad
.RS 15n
edit, starting at end
.RE
.sp
.ne 2
.na
\fB:e +\fIn\fR\fICR\fR\fR
.ad
.RS 15n
edit, starting at line \fIn\fR
.RE
.sp
.ne 2
.na
\fB:e #\fICR\fR\fR
.ad
.RS 15n
edit alternate file
.RE
.sp
.ne 2
.na
\fB:e! #\fICR\fR\fR
.ad
.RS 15n
edit alternate file, discard changes
.RE
.sp
.ne 2
.na
\fB:w \fIname\fR\fICR\fR\fR
.ad
.RS 15n
write file \fIname\fR
.RE
.sp
.ne 2
.na
\fB:w! \fIname\fR\fICR\fR\fR
.ad
.RS 15n
overwrite file \fIname\fR
.RE
.sp
.ne 2
.na
\fB:sh\fICR\fR\fR
.ad
.RS 15n
run shell, then return
.RE
.sp
.ne 2
.na
\fB:!\fIcmd\fR\fICR\fR\fR
.ad
.RS 15n
run \fIcmd\fR, then return
.RE
.sp
.ne 2
.na
\fB:n\fICR\fR\fR
.ad
.RS 15n
edit next file in arglist
.RE
.sp
.ne 2
.na
\fB:n \fIargs\fR\fICR\fR\fR
.ad
.RS 15n
specify new arglist
.RE
.sp
.ne 2
.na
\fB^G\fR
.ad
.RS 15n
show current file and line
.RE
.sp
.ne 2
.na
\fB:ta \fItag\fR\fICR\fR\fR
.ad
.RS 15n
position cursor to \fItag\fR
.RE
.sp
.LP
In general, any \fBex\fR or \fBed\fR command (such as \fIsubstitute\fR or
\fIglobal\fR) can be typed, preceded by a colon and followed by a carriage
return.
.SS "Positioning Within a File"
.ne 2
.na
\fBF\fR
.ad
.RS 14n
forward screen
.RE
.sp
.ne 2
.na
\fB^B\fR
.ad
.RS 14n
backward screen
.RE
.sp
.ne 2
.na
\fB^D\fR
.ad
.RS 14n
scroll down half screen
.RE
.sp
.ne 2
.na
\fB^U\fR
.ad
.RS 14n
scroll up half screen
.RE
.sp
.ne 2
.na
\fB\fIn\fRG\fR
.ad
.RS 14n
go to the beginning of the specified line (end default), where \fIn\fR is a
line number
.RE
.sp
.ne 2
.na
\fB/\fIpat\fR\fR
.ad
.RS 14n
next line matching \fIpat\fR
.RE
.sp
.ne 2
.na
\fB?\fIpat\fR\fR
.ad
.RS 14n
previous line matching \fIpat\fR
.RE
.sp
.ne 2
.na
\fBn\fR
.ad
.RS 14n
repeat last \fB/\fR or \fB?\fR command
.RE
.sp
.ne 2
.na
\fBN\fR
.ad
.RS 14n
reverse last \fB/\fR or \fB?\fR command
.RE
.sp
.ne 2
.na
\fB/\fIpat\fR/+\fIn\fR\fR
.ad
.RS 14n
\fIn\fRth line after \fIpat\fR
.RE
.sp
.ne 2
.na
\fB?\fIpat\fR?\(mi\fIn\fR\fR
.ad
.RS 14n
\fIn\fRth line before \fIpat\fR
.RE
.sp
.ne 2
.na
\fB]]\fR
.ad
.RS 14n
next section/function
.RE
.sp
.ne 2
.na
\fB[[\fR
.ad
.RS 14n
previous section/function
.RE
.sp
.ne 2
.na
\fB(\fR
.ad
.RS 14n
beginning of sentence
.RE
.sp
.ne 2
.na
\fB)\fR
.ad
.RS 14n
end of sentence
.RE
.sp
.ne 2
.na
\fB{\fR
.ad
.RS 14n
beginning of paragraph
.RE
.sp
.ne 2
.na
\fB}\fR
.ad
.RS 14n
end of paragraph
.RE
.sp
.ne 2
.na
\fB%\fR
.ad
.RS 14n
find matching \fB( )\fR or \fB{ }\fR
.RE
.SS "Adjusting the Screen"
.ne 2
.na
\fB^L\fR
.ad
.RS 16n
clear and redraw window
.RE
.sp
.ne 2
.na
\fB^R\fR
.ad
.RS 16n
clear and redraw window if \fB^L\fR is \(-> key
.RE
.sp
.ne 2
.na
\fBz\fICR\fR\fR
.ad
.RS 16n
redraw screen with current line at top of window
.RE
.sp
.ne 2
.na
\fBz\(mi\fICR\fR\fR
.ad
.RS 16n
redraw screen with current line at bottom of window
.RE
.sp
.ne 2
.na
\fBz.\fICR\fR\fR
.ad
.RS 16n
redraw screen with current line at center of window
.RE
.sp
.ne 2
.na
\fB/\fIpat\fR/z\(mi\fICR\fR\fR
.ad
.RS 16n
move \fIpat\fR line to bottom of window
.RE
.sp
.ne 2
.na
\fBz\fIn\fR.\fICR\fR\fR
.ad
.RS 16n
use \fIn\fR\(miline window
.RE
.sp
.ne 2
.na
\fB^E\fR
.ad
.RS 16n
scroll window down one line
.RE
.sp
.ne 2
.na
\fB^Y\fR
.ad
.RS 16n
scroll window up one line
.RE
.SS "Marking and Returning"
.ne 2
.na
\fB\(ga\(ga\fR
.ad
.RS 12n
move cursor to previous context
.RE
.sp
.ne 2
.na
\fBa\'a\'\fR
.ad
.RS 12n
move cursor to first non-white space in line
.RE
.sp
.ne 2
.na
\fBm\fIx\fR\fR
.ad
.RS 12n
mark current position with the \fBASCII\fR lower-case letter \fIx\fR
.RE
.sp
.ne 2
.na
\fB\(ga\fIx\fR\fR
.ad
.RS 12n
move cursor to mark \fIx\fR
.RE
.sp
.ne 2
.na
\fBa\'\fIx\fR\fR
.ad
.RS 12n
move cursor to first non-white space in line marked by \fIx\fR
.RE
.SS "Line Positioning"
.ne 2
.na
\fBH\fR
.ad
.RS 14n
top line on screen
.RE
.sp
.ne 2
.na
\fBL\fR
.ad
.RS 14n
last line on screen
.RE
.sp
.ne 2
.na
\fBM\fR
.ad
.RS 14n
middle line on screen
.RE
.sp
.ne 2
.na
\fB+\fR
.ad
.RS 14n
next line, at first non-white space character
.RE
.sp
.ne 2
.na
\fB\(mi\fR
.ad
.RS 14n
previous line, at first non-white space character
.RE
.sp
.ne 2
.na
\fB\fICR\fR\fR
.ad
.RS 14n
return, same as \fB+\fR
.RE
.sp
.ne 2
.na
\fB\fBdown-arrow\fR\fR
.ad
.br
.na
\fBor \fBj\fR\fR
.ad
.RS 14n
next line, same column
.RE
.sp
.ne 2
.na
\fB\fBup-arrow\fR\fR
.ad
.br
.na
\fBor \fBk\fR\fR
.ad
.RS 14n
previous line, same column
.RE
.SS "Character Positioning"
.ne 2
.na
\fB^\fR
.ad
.RS 13n
first non-white space character
.RE
.sp
.ne 2
.na
\fB0\fR
.ad
.RS 13n
beginning of line
.RE
.sp
.ne 2
.na
\fB$\fR
.ad
.RS 13n
end of line
.RE
.sp
.ne 2
.na
\fB\fBl\fR or \fB\(->\fR\fR
.ad
.RS 13n
forward
.RE
.sp
.ne 2
.na
\fB\fBh\fR or \fB\(<-\fR\fR
.ad
.RS 13n
backward
.RE
.sp
.ne 2
.na
\fB^H\fR
.ad
.RS 13n
same as \fB\(<-\fR (backspace)
.RE
.sp
.ne 2
.na
\fBspace\fR
.ad
.RS 13n
same as \fB\(->\fR (space bar)
.RE
.sp
.ne 2
.na
\fBf\fIx\fR\fR
.ad
.RS 13n
find next \fIx\fR
.RE
.sp
.ne 2
.na
\fBF\fIx\fR\fR
.ad
.RS 13n
find previous \fIx\fR
.RE
.sp
.ne 2
.na
\fBt\fIx\fR\fR
.ad
.RS 13n
move to character following the next \fIx\fR
.RE
.sp
.ne 2
.na
\fBT\fIx\fR\fR
.ad
.RS 13n
move to character following the previous \fIx\fR
.RE
.sp
.ne 2
.na
\fB;\fR
.ad
.RS 13n
repeat last \fBf\fR, \fBF\fR, \fBt\fR, or \fBT\fR
.RE
.sp
.ne 2
.na
\fB,\fR
.ad
.RS 13n
repeat inverse of last \fBf\fR, \fBF\fR, \fBt\fR, or \fBT\fR
.RE
.sp
.ne 2
.na
\fB\fIn\fR|\fR
.ad
.RS 13n
move to column \fIn\fR
.RE
.sp
.ne 2
.na
\fB%\fR
.ad
.RS 13n
find matching \fB( )\fR or \fB{ }\fR
.RE
.SS "Words, Sentences, Paragraphs"
.ne 2
.na
\fBw\fR
.ad
.RS 5n
forward a word
.RE
.sp
.ne 2
.na
\fBb\fR
.ad
.RS 5n
back a word
.RE
.sp
.ne 2
.na
\fBe\fR
.ad
.RS 5n
end of word
.RE
.sp
.ne 2
.na
\fB)\fR
.ad
.RS 5n
to next sentence
.RE
.sp
.ne 2
.na
\fB}\fR
.ad
.RS 5n
to next paragraph
.RE
.sp
.ne 2
.na
\fB(\fR
.ad
.RS 5n
back a sentence
.RE
.sp
.ne 2
.na
\fB{\fR
.ad
.RS 5n
back a paragraph
.RE
.sp
.ne 2
.na
\fBW\fR
.ad
.RS 5n
forward a blank-delimited word
.RE
.sp
.ne 2
.na
\fBB\fR
.ad
.RS 5n
back a blank-delimited word
.RE
.sp
.ne 2
.na
\fBE\fR
.ad
.RS 5n
end of a blank-delimited word
.RE
.SS "Corrections During Insert"
.ne 2
.na
\fB^H\fR
.ad
.RS 16n
erase last character (backspace)
.RE
.sp
.ne 2
.na
\fB^W\fR
.ad
.RS 16n
erase last word
.RE
.sp
.ne 2
.na
\fBerase\fR
.ad
.RS 16n
your erase character, same as \fB^H\fR (backspace)
.RE
.sp
.ne 2
.na
\fBkill\fR
.ad
.RS 16n
your kill character, erase this line of input
.RE
.sp
.ne 2
.na
\fB\e\fR
.ad
.RS 16n
quotes your erase and kill characters
.RE
.sp
.ne 2
.na
\fB\fIESC\fR\fR
.ad
.RS 16n
ends insertion, back to command mode
.RE
.sp
.ne 2
.na
\fBControl\(miC\fR
.ad
.RS 16n
interrupt, suspends insert mode
.RE
.sp
.ne 2
.na
\fB^D\fR
.ad
.RS 16n
backtab one character; reset left margin of \fIautoindent\fR
.RE
.sp
.ne 2
.na
\fB^^D\fR
.ad
.RS 16n
caret (\fB^\fR) followed by control-d (\fB^D\fR); backtab to beginning of line;
do not reset left margin of \fIautoindent\fR
.RE
.sp
.ne 2
.na
\fB0^D\fR
.ad
.RS 16n
backtab to beginning of line; reset left margin of \fIautoindent\fR
.RE
.sp
.ne 2
.na
\fB^V\fR
.ad
.RS 16n
quote non-printable character
.RE
.SS "Insert and Replace"
.ne 2
.na
\fBa\fR
.ad
.RS 12n
append after cursor
.RE
.sp
.ne 2
.na
\fBA\fR
.ad
.RS 12n
append at end of line
.RE
.sp
.ne 2
.na
\fBi\fR
.ad
.RS 12n
insert before cursor
.RE
.sp
.ne 2
.na
\fBI\fR
.ad
.RS 12n
insert before first non-blank
.RE
.sp
.ne 2
.na
\fBo\fR
.ad
.RS 12n
open line below
.RE
.sp
.ne 2
.na
\fBO\fR
.ad
.RS 12n
open line above
.RE
.sp
.ne 2
.na
\fBr\fIx\fR\fR
.ad
.RS 12n
replace single character with \fIx\fR
.RE
.sp
.ne 2
.na
\fBR\fItext\fR\fIESC\fR\fR
.ad
.RS 12n
replace characters
.RE
.SS "Operators"
.LP
Operators are followed by a cursor motion and affect all text that would have
been moved over. For example, since \fBw\fR moves over a word, \fBdw\fR deletes
the word that would be moved over. Double the operator, for example \fBdd\fR,
to affect whole lines.
.sp
.ne 2
.na
\fBd\fR
.ad
.RS 5n
delete
.RE
.sp
.ne 2
.na
\fBc\fR
.ad
.RS 5n
change
.RE
.sp
.ne 2
.na
\fBy\fR
.ad
.RS 5n
yank lines to buffer
.RE
.sp
.ne 2
.na
\fB<\fR
.ad
.RS 5n
left shift
.RE
.sp
.ne 2
.na
\fB>\fR
.ad
.RS 5n
right shift
.RE
.sp
.ne 2
.na
\fB!\fR
.ad
.RS 5n
filter through command
.RE
.SS "Miscellaneous Operations"
.ne 2
.na
\fBC\fR
.ad
.RS 5n
change rest of line (\fBc$\fR)
.RE
.sp
.ne 2
.na
\fBD\fR
.ad
.RS 5n
delete rest of line (\fBd$\fR)
.RE
.sp
.ne 2
.na
\fBs\fR
.ad
.RS 5n
substitute characters (\fBcl\fR)
.RE
.sp
.ne 2
.na
\fBS\fR
.ad
.RS 5n
substitute lines (\fBcc\fR)
.RE
.sp
.ne 2
.na
\fBJ\fR
.ad
.RS 5n
join lines
.RE
.sp
.ne 2
.na
\fBx\fR
.ad
.RS 5n
delete characters (\fBdl\fR)
.RE
.sp
.ne 2
.na
\fBX\fR
.ad
.RS 5n
delete characters before cursor \fBdh\fR)
.RE
.sp
.ne 2
.na
\fBY\fR
.ad
.RS 5n
yank lines (\fByy\fR)
.RE
.SS "Yank and Put"
.LP
Put inserts the text most recently deleted or yanked; however, if a buffer is
named (using the \fBASCII\fR lower-case letters \fBa\fR - \fBz\fR), the text in
that buffer is put instead.
.sp
.ne 2
.na
\fB3yy\fR
.ad
.RS 7n
yank 3 lines
.RE
.sp
.ne 2
.na
\fB3yl\fR
.ad
.RS 7n
yank 3 characters
.RE
.sp
.ne 2
.na
\fBp\fR
.ad
.RS 7n
put back text after cursor
.RE
.sp
.ne 2
.na
\fBP\fR
.ad
.RS 7n
put back text before cursor
.RE
.sp
.ne 2
.na
\fB\fI"x\fRp\fR
.ad
.RS 7n
put from buffer \fIx\fR
.RE
.sp
.ne 2
.na
\fB"\fIx\fRy\fR
.ad
.RS 7n
yank to buffer \fIx\fR
.RE
.sp
.ne 2
.na
\fB"\fIx\fRd\fR
.ad
.RS 7n
delete into buffer \fIx\fR
.RE
.SS "Undo, Redo, Retrieve"
.ne 2
.na
\fBu\fR
.ad
.RS 7n
undo last change
.RE
.sp
.ne 2
.na
\fBU\fR
.ad
.RS 7n
restore current line
.RE
.sp
.ne 2
.na
\fB\&.\fR
.ad
.RS 7n
repeat last change
.RE
.sp
.ne 2
.na
\fB"\fId\fRp\fR
.ad
.RS 7n
retrieve \fId\fR'th last delete
.RE
.SH USAGE
.LP
See \fBlargefile\fR(7) for the description of the behavior of \fBvi\fR and
\fBview\fR when encountering files greater than or equal to 2 Gbyte ( 2^31
bytes).
.SH ENVIRONMENT VARIABLES
.LP
See \fBenviron\fR(7) for descriptions of the following environment variables
that affect the execution of \fBvi\fR: \fBLANG\fR, \fBLC_ALL\fR,
\fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_TIME\fR, \fBLC_MESSAGES\fR,
\fBNLSPATH\fR, \fBPATH\fR, \fBSHELL\fR, and \fBTERM\fR.
.sp
.ne 2
.na
\fB\fBCOLUMNS\fR\fR
.ad
.RS 11n
Override the system-selected horizontal screen size.
.RE
.sp
.ne 2
.na
\fB\fBEXINIT\fR\fR
.ad
.RS 11n
Determine a list of \fBex\fR commands that are executed on editor start-up,
before reading the first file. The list can contain multiple commands by
separating them using a vertical-line (\fB|\fR) character.
.RE
.sp
.ne 2
.na
\fB\fBLINES\fR\fR
.ad
.RS 11n
Override the system-selected vertical screen size, used as the number of lines
in a screenful and the vertical screen size in visual mode.
.RE
.SH FILES
.ne 2
.na
\fB\fB/var/tmp\fR\fR
.ad
.sp .6
.RS 4n
default directory where temporary work files are placed; it can be changed
using the \fBdirectory\fR option (see the \fBex\fR(1) command)
.RE
.sp
.ne 2
.na
\fB\fB/usr/share/lib/terminfo/?/*\fR\fR
.ad
.sp .6
.RS 4n
compiled terminal description database
.RE
.sp
.ne 2
.na
\fB\fB/usr/lib/.COREterm/?/*\fR\fR
.ad
.sp .6
.RS 4n
subset of compiled terminal description database
.RE
.SH ATTRIBUTES
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.SS "/usr/bin/vi, /usr/bin/view, /usr/bin/vedit"
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
CSI Not enabled
.TE
.SS "/usr/xpg4/bin/vi, /usr/xpg4/bin/view, /usr/xpg4/bin/vedit"
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
CSI Enabled
_
Interface Stability Standard
.TE
.SS "/usr/xpg6/bin/vi, /usr/xpg6/bin/view, /usr/xpg6/bin/vedit"
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
CSI Enabled
_
Interface Stability Standard
.TE
.SH SEE ALSO
.LP
.BR Intro (1),
.BR ctags (1),
.BR ed (1),
.BR edit (1),
.BR ex (1),
.BR attributes (7),
.BR environ (7),
.BR largefile (7),
.BR standards (7)
.sp
.LP
\fISolaris Advanced User\&'s Guide\fR
.SH AUTHOR
.LP
\fBvi\fR and \fBex\fR were developed by The University of California, Berkeley
California, Computer Science Division, Department of Electrical Engineering and
Computer Science.
.SH NOTES
.LP
Two options, although they continue to be supported, have been replaced in the
documentation by options that follow the Command Syntax Standard (see
\fBIntro\fR(1)). An \fB-r\fR option that is not followed with an
option-argument has been replaced by \fB-L\fR and \fB+\fR\fBcommand\fR has been
replaced by \fB-c\fR \fBcommand\fR.
.sp
.LP
The message \fBfile too large to recover with\fR \fB-r\fR \fBoption\fR, which
is seen when a file is loaded, indicates that the file can be edited and saved
successfully, but if the editing session is lost, recovery of the file with the
\fB-r\fR option is not possible.
.sp
.LP
The editing environment defaults to certain configuration options. When an
editing session is initiated, \fBvi\fR attempts to read the \fBEXINIT\fR
environment variable. If it exists, the editor uses the values defined in
\fBEXINIT\fR; otherwise the values set in \fB$HOME/.exrc\fR are used. If
\fB$HOME/.exrc\fR does not exist, the default values are used.
.sp
.LP
To use a copy of \fB\&.exrc\fR located in the current directory other than
\fB$HOME\fR, set the \fIexrc\fR option in \fBEXINIT\fR or \fB$HOME/.exrc\fR.
Options set in \fBEXINIT\fR can be turned off in a local \fB\&.exrc\fR only if
\fIexrc\fR is set in \fBEXINIT\fR or \fB$HOME/.exrc\fR. In order to be used,
\fI\&.exrc\fR in \fB$HOME\fR or the current directory must fulfill these
conditions:
.RS +4
.TP
.ie t \(bu
.el o
It must exist.
.RE
.RS +4
.TP
.ie t \(bu
.el o
It must be owned by the same userid as the real userid of the process, or the
process has appropriate privileges.
.RE
.RS +4
.TP
.ie t \(bu
.el o
It is not writable by anyone other than the owner.
.RE
.sp
.LP
Tampering with entries in \fB/usr/share/lib/terminfo/?/*\fR or
\fB/usr/share/lib/terminfo/?/*\fR (for example, changing or removing an entry)
can affect programs such as \fBvi\fR that expect the entry to be present and
correct. In particular, removing the "dumb" terminal can cause unexpected
problems.
.sp
.LP
Software tabs using \fB^T\fR work only immediately after the \fIautoindent\fR.
.sp
.LP
Left and right shifts on intelligent terminals do not make use of insert and
delete character operations in the terminal.
.sp
.LP
Loading an alternate \fBmalloc()\fR library using the environment variable
\fBLD_PRELOAD\fR can cause problems for \fB/usr/bin/vi\fR.
.sp
.LP
The \fBvi\fR utility currently has the following limitations:
.RS +4
.TP
1.
Lines, including the trailing NEWLINE character, can contain no more than
4096 bytes.
.sp
If a longer line is found, \fBLine too long\fR is displayed in the status line.
.RE
.RS +4
.TP
2.
The editor's temporary work file can be no larger than 128Mb.
.sp
If a larger temporary file is needed, \fBTmp file too large\fR is displayed in
the status line.
.RE
|