File: zshzle.1

package info (click to toggle)
zsh-beta 4.3.0-dev-1%2B20050424-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,240 kB
  • ctags: 6,564
  • sloc: ansic: 79,241; sh: 4,874; perl: 748; makefile: 676; awk: 341; sed: 16
file content (1777 lines) | stat: -rw-r--r-- 67,102 bytes parent folder | download
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
.TH "ZSHZLE" "1" "August 16, 2004" "zsh 4\&.2\&.1-dev-1"
.SH "NAME"
zshzle \- zsh command line editor
.\" Yodl file: Zsh/zle.yo
.SH "DESCRIPTION"
If the \fBZLE\fP option is set (which it is by default in interactive shells)
and the shell input is attached to the terminal, the user
is able to edit command lines\&.
.PP
There are two display modes\&.  The first, multiline mode, is the
default\&.  It only works if the \fBTERM\fP parameter is set to a valid
terminal type that can move the cursor up\&.  The second, single line
mode, is used if \fBTERM\fP is invalid or incapable of moving the
cursor up, or if the \fBSINGLE_LINE_ZLE\fP option is set\&.
This mode
is similar to \fBksh\fP, and uses no termcap sequences\&.  If \fBTERM\fP is
"emacs", the \fBZLE\fP option will be unset by default\&.
.PP
The parameters \fBBAUD\fP, \fBCOLUMNS\fP, and \fBLINES\fP are also used by the
line editor\&.
See \fIParameters Used By The Shell\fP in \fIzshparam\fP(1)\&.
.PP
.PP
.SH "KEYMAPS"
A keymap in ZLE contains a set of bindings between key sequences
and ZLE commands\&.  The empty key sequence cannot be bound\&.
.PP
There can be any number of keymaps at any time, and each keymap has one
or more names\&.  If all of a keymap's names are deleted, it disappears\&.
\fBbindkey\fP can be used to manipulate keymap names\&.
.PP
Initially, there are four keymaps:
.PP
.PD 0
.TP
\fBemacs\fP
EMACS emulation
.TP
\fBviins\fP
vi emulation \- insert mode
.TP
\fBvicmd\fP
vi emulation \- command mode
.TP
\fB\&.safe\fP
fallback keymap
.PD
.PP
The `\fB\&.safe\fP' keymap is special\&.  It can never be altered, and the name
can never be removed\&.  However, it can be linked to other names, which can
be removed\&.  In the future other special keymaps may be added; users should
avoid using names beginning with `\fB\&.\fP' for their own keymaps\&.
.PP
In addition to these four names, either `\fBemacs\fP' or `\fBviins\fP' is
also linked to the name `\fBmain\fP'\&.  If one of the \fBVISUAL\fP or
\fBEDITOR\fP environment variables contain the string `\fBvi\fP' when the shell
starts up then it will be `\fBviins\fP', otherwise it will be `\fBemacs\fP'\&.
\fBbindkey\fP's \fB\-e\fP and \fB\-v\fP
options provide a convenient way to override this default choice\&.
.PP
When the editor starts up, it will select the `\fBmain\fP' keymap\&.
If that keymap doesn't exist, it will use `\fB\&.safe\fP' instead\&.
.PP
In the `\fB\&.safe\fP' keymap, each single key is bound to \fBself\-insert\fP,
except for ^J (line feed) and ^M (return) which are bound to \fBaccept\-line\fP\&.
This is deliberately not pleasant to use; if you are using it, it
means you deleted the main keymap, and you should put it back\&.
.SS "Reading Commands"
When ZLE is reading a command from the terminal, it may read a sequence
that is bound to some command and is also a prefix of a longer bound string\&.
In this case ZLE will wait a certain time to see if more characters
are typed, and if not (or they don't match any longer string) it will
execute the binding\&.  This timeout is defined by the \fBKEYTIMEOUT\fP parameter;
its default is 0\&.4 sec\&.  There is no timeout if the prefix string is not
itself bound to a command\&.
.PP
As well as ZLE commands, key sequences can be bound to other strings, by using
`\fBbindkey \-s\fP'\&.
When such a sequence is read, the replacement string is pushed back as input,
and the command reading process starts again using these fake keystrokes\&.
This input can itself invoke further replacement strings, but in order to
detect loops the process will be stopped if there are twenty such replacements
without a real command being read\&.
.PP
.SH "ZLE BUILTINS"
The ZLE module contains three related builtin commands\&. The \fBbindkey\fP
command manipulates keymaps and key bindings; the \fBvared\fP command invokes
ZLE on the value of a shell parameter; and the \fBzle\fP command manipulates
editing widgets and allows command line access to ZLE commands from within
shell functions\&.
.PP
.PD 0
.TP
.PD 0
\fBbindkey\fP [ \fIoptions\fP ] \fB\-l\fP
.TP
.PD 0
\fBbindkey\fP [ \fIoptions\fP ] \fB\-d\fP
.TP
.PD 0
\fBbindkey\fP [ \fIoptions\fP ] \fB\-D\fP \fIkeymap\fP \&.\&.\&.
.TP
.PD 0
\fBbindkey\fP [ \fIoptions\fP ] \fB\-A\fP \fIold\-keymap new\-keymap\fP
.TP
.PD 0
\fBbindkey\fP [ \fIoptions\fP ] \fB\-N\fP \fInew\-keymap\fP [ \fIold\-keymap\fP ]
.TP
.PD 0
\fBbindkey\fP [ \fIoptions\fP ] \fB\-m\fP
.TP
.PD 0
\fBbindkey\fP [ \fIoptions\fP ] \fB\-r\fP \fIin\-string\fP \&.\&.\&.
.TP
.PD 0
\fBbindkey\fP [ \fIoptions\fP ] \fB\-s\fP \fIin\-string out\-string\fP \&.\&.\&.
.TP
.PD 0
\fBbindkey\fP [ \fIoptions\fP ] \fIin\-string command\fP \&.\&.\&.
.TP
.PD
\fBbindkey\fP [ \fIoptions\fP ] [ \fIin\-string\fP ]
\fBbindkey\fP's options can be divided into three categories: keymap selection,
operation selection, and others\&.  The keymap selection options are:
.RS
.PP
.PD 0
.TP
.PD
\fB\-e\fP
Selects keymap `\fBemacs\fP', and also links it to `\fBmain\fP'\&.
.TP
\fB\-v\fP
Selects keymap `\fBviins\fP', and also links it to `\fBmain\fP'\&.
.TP
\fB\-a\fP
Selects keymap `\fBvicmd\fP'\&.
.TP
\fB\-M\fP \fIkeymap\fP
The \fIkeymap\fP specifies a keymap name\&.
.PP
If a keymap selection is required and none of the options above are used, the
`\fBmain\fP' keymap is used\&.  Some operations do not permit a keymap to be
selected, namely:
.PP
.PD 0
.TP
.PD
\fB\-l\fP
List all existing keymap names\&.  If the \fB\-L\fP
option is also used, list in the form of \fBbindkey\fP
commands to create the keymaps\&.
.TP
\fB\-d\fP
Delete all existing keymaps and reset to the default state\&.
.TP
\fB\-D\fP \fIkeymap\fP \&.\&.\&.
Delete the named \fIkeymap\fPs\&.
.TP
\fB\-A\fP \fIold\-keymap new\-keymap\fP
Make the \fInew\-keymap\fP name an alias for \fIold\-keymap\fP, so that
both names refer to the same keymap\&.  The names have equal standing;
if either is deleted, the other remains\&.  If there is already a keymap
with the \fInew\-keymap\fP name, it is deleted\&.
.TP
\fB\-N\fP \fInew\-keymap\fP [ \fIold\-keymap\fP ]
Create a new keymap, named \fInew\-keymap\fP\&.  If a keymap already has that
name, it is deleted\&.  If an \fIold\-keymap\fP name is given, the new keymap
is initialized to be a duplicate of it, otherwise the new keymap will
be empty\&.
.PP
To use a newly created keymap, it should be linked to \fBmain\fP\&.  Hence
the sequence of commands to create and use a new keymap `\fBmymap\fP'
initialized from the \fBemacs\fP keymap (which remains unchanged) is:
.PP
.RS
.nf
\fBbindkey \-N mymap emacs
bindkey \-A mymap main\fP
.fi
.RE
.PP
Note that while `\fBbindkey \-A\fP \fInewmap\fP \fBmain\fP' will work when
\fInewmap\fP is \fBemacs\fP or \fBviins\fP, it will not work for \fBvicmd\fP, as
switching from vi insert to command mode becomes impossible\&.
.PP
The following operations act on the `\fBmain\fP' keymap if no keymap
selection option was given:
.PP
.PD 0
.TP
.PD
\fB\-m\fP
Add the built\-in set of meta\-key bindings to the selected keymap\&.
Only keys that are unbound or bound to \fBself\-insert\fP are affected\&.
.TP
\fB\-r\fP \fIin\-string\fP \&.\&.\&.
Unbind the specified \fIin\-string\fPs in the selected keymap\&.
This is exactly equivalent to binding the strings to \fBundefined\-key\fP\&.
.RS
.PP
When \fB\-R\fP is also used, interpret the \fIin\-string\fPs as ranges\&.
.PP
When \fB\-p\fP is also used, the \fIin\-string\fPs specify prefixes\&.  Any
binding that has the given \fIin\-string\fP as a prefix, not including the
binding for the \fIin\-string\fP itself, if any, will be removed\&.  For
example,
.PP
.RS
.nf
\fBbindkey \-rpM viins '^['\fP
.fi
.RE
.PP
will remove all bindings in the vi\-insert keymap beginning with an escape
character (probably cursor keys), but leave the binding for the escape
character itself (probably \fBvi\-cmd\-mode\fP)\&.  This is incompatible with the
option \fB\-R\fP\&.
.RE
.TP
\fB\-s\fP \fIin\-string out\-string\fP \&.\&.\&.
Bind each \fIin\-string\fP to each \fIout\-string\fP\&.
When \fIin\-string\fP is typed, \fIout\-string\fP will be
pushed back and treated as input to the line editor\&.
When \fB\-R\fP is also used, interpret the \fIin\-string\fPs as ranges\&.
.TP
\fIin\-string command\fP \&.\&.\&.
Bind each \fIin\-string\fP to each \fIcommand\fP\&.
When \fB\-R\fP is used, interpret the \fIin\-string\fPs as ranges\&.
.TP
[ \fIin\-string\fP ]
List key bindings\&.  If an \fIin\-string\fP is specified, the binding of
that string in the selected keymap is displayed\&.  Otherwise, all key
bindings in the selected keymap are displayed\&.  (As a special case,
if the \fB\-e\fP or \fB\-v\fP option is used alone, the keymap is \fInot\fP
displayed \- the implicit linking of keymaps is the only thing that
happens\&.)
.RS
.PP
When the option \fB\-p\fP is used, the \fIin\-string\fP must be present\&.
The listing shows all bindings which have the given key sequence as a
prefix, not including any bindings for the key sequence itself\&.
.PP
When the \fB\-L\fP option is used, the list is in the form of \fBbindkey\fP
commands to create the key bindings\&.
.RE
.RE
.PP
When the \fB\-R\fP option is used as noted above, a valid range consists of
two characters, with an optional `\fB\-\fP' between them\&.  All characters
between the two specified, inclusive, are bound as specified\&.
.PP
For either \fIin\-string\fP or \fIout\-string\fP, the following
escape sequences are recognised:
.PP
.PD 0
.TP
\fB\ea\fP
bell character
.TP
\fB\eb\fP
backspace
.TP
\fB\ee\fP, \fB\eE\fP
escape
.TP
\fB\ef\fP
form feed
.TP
\fB\en\fP
linefeed (newline)
.TP
\fB\er\fP
carriage return
.TP
\fB\et\fP
horizontal tab
.TP
\fB\ev\fP
vertical tab
.TP
\fB\e\fP\fINNN\fP
character code in octal
.TP
\fB\ex\fP\fINN\fP
character code in hexadecimal
.TP
\fB\eM\fP[\fB\-\fP]\fIX\fP
character with meta bit set
.TP
\fB\eC\fP[\fB\-\fP]\fIX\fP
control character
.TP
\fB^\fP\fIX\fP
control character
.PD
.PP
In all other cases, `\fB\e\fP' escapes the following character\&.  Delete is
written as `\fB^?\fP'\&.  Note that `\fB\eM^?\fP' and `\fB^\eM?\fP' are not the same,
and that (unlike emacs), the bindings `\fB\eM\-\fP\fIX\fP' and `\fB\ee\fP\fIX\fP'
are entirely distinct, although they are initialized to the same bindings
by `\fBbindkey \-m\fP'\&.
.RE
.TP
.PD 0
\fBvared\fP [ \fB\-Aache\fP ] [ \fB\-p\fP \fIprompt\fP ] [ \fB\-r\fP \fIrprompt\fP ]
.TP
.PD
  [ \-M \fImain\-keymap\fP ] [ \-m \fIvicmd\-keymap\fP ] \fIname\fP
The value of the parameter \fIname\fP is loaded into the edit
buffer, and the line editor is invoked\&.  When the editor exits,
\fIname\fP is set to the string value returned by the editor\&.
When the \fB\-c\fP flag is given, the parameter is created if it doesn't
already exist\&.  The \fB\-a\fP flag may be given with \fB\-c\fP to create
an array parameter, or the \fB\-A\fP flag to create an associative array\&.
If the type of an existing parameter does not match the type to be
created, the parameter is unset and recreated\&.
.RS
.PP
If an array or array slice is being edited, separator characters as defined
in \fB$IFS\fP will be shown quoted with a backslash, as will backslashes
themselves\&.  Conversely, when the edited text is split into an array, a
backslash quotes an immediately following separator character or backslash;
no other special handling of backslashes, or any handling of quotes, is
performed\&.
.PP
Individual elements of existing array or associative array parameters
may be edited by using subscript syntax on \fIname\fP\&.  New elements are
created automatically, even without \fB\-c\fP\&.
.PP
If the \fB\-p\fP flag is given, the following string will be taken as
the prompt to display at the left\&.  If the \fB\-r\fP flag is given,
the following string gives the prompt to display at the right\&.  If the
\fB\-h\fP flag is specified, the history can be accessed from ZLE\&. If the
\fB\-e\fP flag is given, typing \fB^D\fP (Control\-D) on an empty line
causes \fBvared\fP to exit immediately with a non\-zero return value\&.
.PP
The \fB\-M\fP option gives a keymap to link to the \fBmain\fP keymap during
editing, and the \fB\-m\fP option gives a keymap to link to the \fBvicmd\fP
keymap during editing\&.  For vi\-style editing, this allows a pair of keymaps
to override \fBviins\fP and \fBvicmd\fP\&.  For emacs\-style editing, only \fB\-M\fP
is normally needed but the \fB\-m\fP option may still be used\&.  On exit, the
previous keymaps will be restored\&.
.RE
.TP
.PD 0
\fBzle\fP
.TP
.PD 0
\fBzle\fP \fB\-l\fP [ \fB\-L\fP | \fB\-a\fP ] [ \fIstring\fP \&.\&.\&. ]
.TP
.PD 0
\fBzle\fP \fB\-D\fP \fIwidget\fP \&.\&.\&.
.TP
.PD 0
\fBzle\fP \fB\-A\fP \fIold\-widget\fP \fInew\-widget\fP
.TP
.PD 0
\fBzle\fP \fB\-N\fP \fIwidget\fP [ \fIfunction\fP ]
.TP
.PD 0
\fBzle\fP \fB\-C\fP \fIwidget\fP \fIcompletion\-widget\fP \fIfunction\fP
.TP
.PD 0
\fBzle\fP \fB\-R\fP [ \fB\-c\fP ] [ \fIdisplay\-string\fP ] [ \fIstring\fP \&.\&.\&. ]
.TP
.PD 0
\fBzle\fP \fB\-M\fP \fIstring\fP
.TP
.PD 0
\fBzle\fP \fB\-U\fP \fIstring\fP
.TP
.PD 0
\fBzle\fP \fB\-K\fP \fIkeymap\fP
.TP
.PD 0
\fBzle\fP \fB\-F\fP [ \fB\-L\fP ] [ \fIfd\fP [ \fIhandler\fP ] ]
.TP
.PD 0
\fBzle\fP \fB\-I\fP
.TP
.PD
\fBzle\fP \fIwidget\fP \fB[ \-n\fP \fInum\fP \fB]\fP \fB[ \-N ]\fP \fIargs\fP \&.\&.\&.
The \fBzle\fP builtin performs a number of different actions concerning
ZLE\&.
.RS
.PP
With no options and no arguments, only the return status will be
set\&.  It is zero if ZLE is currently active and widgets could be
invoked using this builtin command and non\-zero otherwise\&.
Note that even if non\-zero status is returned, zle may still be active as
part of the completion system; this does not allow direct calls to ZLE
widgets\&.
.PP
Otherwise, which operation it performs depends on its options:
.PP
.PD 0
.TP
.PD
\fB\-l\fP [ \fB\-L\fP | \fB\-a\fP ]
List all existing user\-defined widgets\&.  If the \fB\-L\fP
option is used, list in the form of \fBzle\fP
commands to create the widgets\&.
.RS
.PP
When combined with the \fB\-a\fP option, all widget names are listed,
including the builtin ones\&. In this case the \fB\-L\fP option is ignored\&.
.PP
If at least one \fIstring\fP is given, nothing will be printed but the
return status will be zero if all \fIstring\fPs are names of existing
widgets (or of user\-defined widgets if the \fB\-a\fP flag is not given)
and non\-zero if at least one \fIstring\fP is not a name of an defined
widget\&.
.RE
.TP
\fB\-D\fP \fIwidget\fP \&.\&.\&.
Delete the named \fIwidget\fPs\&.
.TP
\fB\-A\fP \fIold\-widget\fP \fInew\-widget\fP
Make the \fInew\-widget\fP name an alias for \fIold\-widget\fP, so that
both names refer to the same widget\&.  The names have equal standing;
if either is deleted, the other remains\&.  If there is already a widget
with the \fInew\-widget\fP name, it is deleted\&.
.TP
\fB\-N\fP \fIwidget\fP [ \fIfunction\fP ]
Create a user\-defined widget\&.  If there is already a widget with the
specified name, it is overwritten\&.  When the new
widget is invoked from within the editor, the specified shell \fIfunction\fP
is called\&.  If no function name is specified, it defaults to
the same name as the widget\&.  For further information, see the section
\fIWidgets\fP in
\fIzshzle\fP(1)\&.
.TP
\fB\-C\fP \fIwidget\fP \fIcompletion\-widget\fP \fIfunction\fP
Create a user\-defined completion widget named \fIwidget\fP\&. The 
completion widget will behave like the built\-in completion\-widget
whose name is given as \fIcompletion\-widget\fP\&. To generate the
completions, the shell function \fIfunction\fP will be called\&.
For further information, see
\fIzshcompwid\fP(1)\&.
.TP
\fB\-R\fP [ \fB\-c\fP ] [ \fIdisplay\-string\fP ] [ \fIstring\fP \&.\&.\&. ]
Redisplay the command line; this is to be called from within a user\-defined
widget to allow changes to become visible\&.  If a \fIdisplay\-string\fP is
given and not empty, this is shown in the status line (immediately
below the line being edited)\&.
.RS
.PP
If the optional \fIstring\fPs are given they are listed below the
prompt in the same way as completion lists are printed\&. If no
\fIstring\fPs are given but the \fB\-c\fP option is used such a list is
cleared\&.
.PP
Note that this option is only useful for widgets that do not exit
immediately after using it because the strings displayed will be erased 
immediately after return from the widget\&.
.PP
This command can safely be called outside user defined widgets; if zle is
active, the display will be refreshed, while if zle is not active, the
command has no effect\&.  In this case there will usually be no other
arguments\&.
.PP
The status is zero if zle was active, else one\&.
.RE
.TP
\fB\-M\fP \fIstring\fP
As with the \fB\-R\fP option, the \fIstring\fP will be displayed below the 
command line; unlike the \fB\-R\fP option, the string will not be put into
the status line but will instead be printed normally below the
prompt\&.  This means that the \fIstring\fP will still be displayed after
the widget returns (until it is overwritten by subsequent commands)\&.
.TP
\fB\-U\fP \fIstring\fP
This pushes the characters in the \fIstring\fP onto the input stack of
ZLE\&.  After the widget currently executed finishes ZLE will behave as
if the characters in the \fIstring\fP were typed by the user\&.
.RS
.PP
As ZLE uses a stack, if this option is used repeatedly
the last string pushed onto the stack will be processed first\&.  However,
the characters in each \fIstring\fP will be processed in the order in which
they appear in the string\&.
.RE
.TP
\fB\-K\fP \fIkeymap\fP
Selects the keymap named \fIkeymap\fP\&.  An error message will be displayed if
there is no such keymap\&.
.RS
.PP
This keymap selection affects the interpretation of following keystrokes
within this invocation of ZLE\&.  Any following invocation (e\&.g\&., the next
command line) will start as usual with the `\fBmain\fP' keymap selected\&.
.RE
.TP
\fB\-F\fP [ \fB\-L\fP ] [ \fIfd\fP [ \fIhandler\fP ] ]
Only available if your system supports one of the `poll' or `select' system
calls; most modern systems do\&.
.RS
.PP
Installs \fIhandler\fP (the name of a shell function) to handle input from
file descriptor \fIfd\fP\&.  When zle is attempting to read data, it will
examine both the terminal and the list of handled \fIfd\fP's\&.  If data
becomes available on a handled \fIfd\fP, zle will call \fIhandler\fP with
the fd which is ready for reading as the only argument\&.  If the handler
produces output to the terminal, it should call `\fBzle \-I\fP' before doing
so (see below)\&.  The handler should not attempt to read from the terminal\&.
Note that zle makes no attempt to check whether this fd is actually
readable when installing the handler\&.  The user must make their own
arrangements for handling the file descriptor when zle is not active\&.
.PP
Any number of handlers for any number of readable file descriptors may be
installed\&.  Installing a handler for an \fIfd\fP which is already handled
causes the existing handler to be replaced\&.
.PP
If no \fIhandler\fP is given, but an \fIfd\fP is present, any handler for
that \fIfd\fP is removed\&.  If there is none, an error message is printed
and status 1 is returned\&.
.PP
If no arguments are given, or the \fB\-L\fP option is supplied, a list of
handlers is printed in a form which can be stored for later execution\&.
.PP
An \fIfd\fP (but not a \fIhandler\fP) may optionally be given with the \fB\-L\fP
option; in this case, the function will list the handler if any, else
silently return status 1\&.
.PP
Note that this feature should be used with care\&.  Activity on one of the
\fIfd\fP's which is not properly handled can cause the terminal to become
unusable\&.
.PP
Here is a simple example of using this feature\&.  A connection to a remote
TCP port is created using the ztcp command; see 
the description of the \fBzsh/net/tcp\fP module in \fIzshmodules\fP(1)\&.  Then a handler is installed
which simply prints out any data which arrives on this connection\&.  Note
that `select' will indicate that the file descriptor needs handling
if the remote side has closed the connection; we handle that by testing
for a failed read\&.
.RS
.nf
\fBif ztcp pwspc 2811; then
  tcpfd=$REPLY
  handler() {
    zle \-I
    local line
    if ! read \-r line <&$1; then
      # select marks this fd if we reach EOF,
      # so handle this specially\&.
      print "[Read on fd $1 failed, removing\&.]" >&2
      zle \-F $1
      return 1
    fi
    print \-r \- $line
  }
  zle \-F $tcpfd handler
fi\fP
.fi
.RE
.RE
.TP
\fB\-I\fP
Unusually, this option is most useful outside ordinary widget functions,
though it may be used within if normal output to the terminal is required\&.
It invalidates the current zle display in preparation for output; typically
this will be from a trap function\&.  It has no effect if zle is not
active\&.  When a trap exits, the shell checks to see if the display needs
restoring, hence the following will print output in such a way as not to
disturb the line being edited:
.RS
.PP
.RS
.nf
\fBTRAPUSR1() {
    # Invalidate zle display
  [[ \-o zle ]] && zle \-I
    # Show output
  print Hello
}\fP
.fi
.RE
.PP
In general, the trap function may need to test whether zle is active before
using this method (as shown in the example), since the \fBzsh/zle\fP module
may not even be loaded; if it is not, the command can be skipped\&.
.PP
It is possible to call `\fBzle \-I\fP' several times before control is
returned to the editor; the display will only be invalidated the first time
to minimise disruption\&.
.PP
Note that there are normally better ways of manipulating the display from
within zle widgets; see, for example, `\fBzle \-R\fP' above\&.
.PP
The returned status is zero if zle was invalidated, even though
this may have been by a previous call to `\fBzle \-I\fP' or by a system
notification\&.  To test if a zle widget may be called at this point, execute
\fBzle\fP with no arguments and examine the return status\&.
.RE
.TP
\fIwidget\fP \fB[ \-n\fP \fInum\fP \fB]\fP \fB[ \-N ]\fP \fIargs\fP \&.\&.\&.
Invoke the specified widget\&.  This can only be done when ZLE is
active; normally this will be within a user\-defined widget\&.
.RS
.PP
With the options \fB\-n\fP and \fB\-N\fP, the current numerical argument will be
saved and then restored after the call to \fBwidget\fP; `\fB\-n\fP \fInum\fP'
sets the numerical argument temporarily to \fInum\fP, while `\fB\-N\fP' sets it
to the default, i\&.e\&. as if there were none\&.
.PP
Any further arguments will be passed to the widget\&.  If it is a shell
function, these are passed down as positional parameters; for builtin
widgets it is up to the widget in question what it does with them\&.
Currently arguments are only handled by the incremental\-search commands,
the \fBhistory\-search\-forward\fP and \fB\-backward\fP and the corresponding
functions prefixed by \fBvi\-\fP, and by \fBuniversal\-argument\fP\&.  No error is
flagged if the command does not use the arguments, or only uses some of
them\&.
.PP
The return status reflects the success or failure of the operation carried
out by the widget, or if it is a user\-defined widget the return status of
the shell function\&.  
.PP
A non\-zero return status causes the shell to beep when the widget exits,
unless the \fBBEEP\fP options was unset or the widget was called via the
\fBzle\fP command\&.  Thus if a user defined widget requires an immediate beep,
it should call the \fBbeep\fP widget directly\&.
.RE
.RE
.RE
.RE
.PP
.SH "WIDGETS"
All actions in the editor are performed by `widgets'\&.  A widget's job is
simply to perform some small action\&.  The ZLE commands that key sequences
in keymaps are bound to are in fact widgets\&.  Widgets can be user\-defined
or built in\&.
.PP
The standard widgets built in to ZLE are listed in Standard Widgets below\&.
Other built\-in widgets can be defined by other modules (see
\fIzshmodules\fP(1))\&.  Each built\-in widget has two names: its normal canonical name, and the
same name preceded by a `\fB\&.\fP'\&.  The `\fB\&.\fP' name is special: it can't be
rebound to a different widget\&.  This makes the widget available even when
its usual name has been redefined\&.
.PP
User\-defined widgets are defined using `\fBzle \-N\fP', and implemented
as shell functions\&.  When the widget is executed, the corresponding
shell function is executed, and can perform editing (or other) actions\&.
It is recommended that user\-defined widgets should not have names
starting with `\fB\&.\fP'\&.
.SH "USER\-DEFINED WIDGETS"
User\-defined widgets, being implemented as shell functions,
can execute any normal shell command\&.  They can also run other widgets
(whether built\-in or user\-defined) using the \fBzle\fP builtin command\&.
The standard input of the function is closed to prevent external commands
from unintentionally blocking ZLE by reading from the terminal, but
\fBread \-k\fP or \fBread \-q\fP can be used to read characters\&.  Finally,
they can examine and edit the ZLE buffer being edited by
reading and setting the special parameters described below\&.
.PP
These special parameters are always available in widget functions, but
are not in any way special outside ZLE\&.  If they have some normal value
outside ZLE, that value is temporarily inaccessible, but will return
when the widget function exits\&.  These special parameters in fact have
local scope, like parameters created in a function using \fBlocal\fP\&.
.PP
Inside completion widgets and traps called while ZLE is active, these
parameters are available read\-only\&.
.PP
.PD 0
.TP
.PD
\fBBUFFER\fP (scalar)
The entire contents of the edit buffer\&.  If it is written to, the
cursor remains at the same offset, unless that would put it outside the
buffer\&.
.TP
\fBBUFFERLINES\fP (integer)
The number of screen lines needed for the edit buffer currently
displayed on screen (i\&.e\&. without any changes to the preceding
parameters done after the last redisplay); read\-only\&.
.TP
\fBCONTEXT\fP (scalar)
The context in which zle was called to read a line; read\-only\&.  One of
the values:
.PD 0
.TP
.PD
start
The start of a command line (at prompt \fBPS1\fP)\&.
.TP
cont
A continuation to a command line (at prompt \fBPS2\fP)\&.
.TP
select
In a \fBselect\fP loop\&.
.TP
vared
Editing a variable in \fBvared\fP\&.
.RE
.TP
\fBCURSOR\fP (integer)
The offset of the cursor, within the edit buffer\&.  This is in the range
0 to \fB$#BUFFER\fP, and is by definition equal to \fB$#LBUFFER\fP\&.
Attempts to move the cursor outside the buffer will result in the
cursor being moved to the appropriate end of the buffer\&.
.TP
\fBCUTBUFFER\fP (scalar)
The last item to be cut using one of the `\fBkill\-\fP' commands; the
string which the next yank would insert in the line\&.
.TP
\fBHISTNO\fP (integer)
The current history number\&.  Setting this has the same effect as
moving up or down in the history to the corresponding history line\&.
An attempt to set it is ignored if the line is not stored in the
history\&.  Note this is not the same as the parameter \fBHISTCMD\fP,
which always gives the number of the history line being added to the main
shell's history\&.  \fBHISTNO\fP refers to the line being retrieved within
zle\&.
.TP
\fBKEYMAP\fP (scalar)
The name of the currently selected keymap; read\-only\&.
.TP
\fBKEYS\fP (scalar)
The keys typed to invoke this widget, as a literal string; read\-only\&.
.TP
\fBkillring\fP (array)
The array of previously killed items, with the most recently killed first\&.
This gives the items that would be retrieved by a \fByank\-pop\fP in the
same order\&.
.RS
.PP
The default size for the kill ring is eight, however the length may be
changed by normal array operations\&.  Any empty string in the kill ring is
ignored by the \fByank\-pop\fP command, hence the size of the array
effectively sets the maximum length of the kill ring, while the number of
non\-zero strings gives the current length, both as seen by the user at the
command line\&.
.RE
.PP
.TP
\fBLASTSEARCH\fP (scalar)
The last search string used by an interactive search ; read\-only\&.
.TP
\fBLASTWIDGET\fP (scalar)
The name of the last widget that was executed; read\-only\&.
.TP
\fBLBUFFER\fP (scalar)
The part of the buffer that lies to the left of the cursor position\&.
If it is assigned to, only that part of the buffer is replaced, and the
cursor remains between the new \fB$LBUFFER\fP and the old \fB$RBUFFER\fP\&.
.TP
\fBMARK\fP (integer)
Like \fBCURSOR\fP, but for the mark\&.
.TP
\fBNUMERIC\fP (integer)
The numeric argument\&. If no numeric argument was given, this parameter
is unset\&. When this is set inside a widget function, builtin widgets
called with the \fBzle\fP builtin command will use the value
assigned\&. If it is unset inside a widget function, builtin widgets
called behave as if no numeric argument was given\&.
.TP
\fBPENDING\fP (integer)
The number of bytes pending for input, i\&.e\&. the number of bytes which have
already been typed and can immediately be read\&. On systems where the shell
is not able to get this information, this parameter will always have a
value of zero\&.  Read\-only\&.
.TP
\fBPREBUFFER\fP (scalar)
In a multi\-line input at the secondary prompt, this read\-only parameter
contains the contents of the lines before the one the cursor is
currently in\&.
.TP
\fBPREDISPLAY\fP (scalar)
Text to be displayed before the start of the editable text buffer\&.  This
does not have to be a complete line; to display a complete line, a newline
must be appended explicitly\&.    The text is reset on each new invocation
(but not recursive invocation) of zle\&.
.TP
\fBPOSTDISPLAY\fP (scalar)
Text to be displayed after the end of the editable text buffer\&.  This
does not have to be a complete line; to display a complete line, a newline
must be prepended explicitly\&.  The text is reset on each new invocation
(but not recursive invocation) of zle\&.
.TP
\fBRBUFFER\fP (scalar)
The part of the buffer that lies to the right of the cursor position\&.
If it is assigned to, only that part of the buffer is replaced, and the
cursor remains between the old \fB$LBUFFER\fP and the new \fB$RBUFFER\fP\&.
.TP
\fBWIDGET\fP (scalar)
The name of the widget currently being executed; read\-only\&.
.TP
\fBWIDGETFUNC\fP (scalar)
The name of the shell function that implements a widget defined with
either \fBzle \-N\fP or \fBzle \-C\fP\&.  In the former case, this is the second
argument to the \fBzle \-N\fP command that defined the widget, or
the first argument if there was no second argument\&.  In the latter case
this is the the third argument to the \fBzle \-C\fP command that defined the
widget\&.  Read\-only\&.
.TP
\fBWIDGETSTYLE\fP (scalar)
Describes the implementation behind the completion widget currently being
executed; the second argument that followed \fBzle \-C\fP when the widget was
defined\&.  This is the name of a builtin completion widget\&.  For widgets
defined with \fBzle \-N\fP this is set to the empty string\&.  Read\-only\&.
.PP
.SS "Special Widget"
.PP
There is one user\-defined widget which is special to the shell\&.
If it does not exist, no special action is taken\&.  The environment
provided is identical to that for any other editing widget\&.
.PP
.PD 0
.TP
.PD
\fBzle\-line\-init\fP
Executed every time the line editor is started to read a new line
of input\&.  The following example puts the line editor into vi command
mode when it starts up\&.
.RS
.PP
.RS
.nf
\fBzle\-line\-init() { zle \-K vicmd; }
zle \-N zle\-line\-init\fP
.fi
.RE
.PP
(The command inside the function sets the keymap directly; it is
equivalent to \fBzle vi\-cmd\-mode\fP\&.)
.RE
.RE
.PP
.SH "STANDARD WIDGETS"
The following is a list of all the standard widgets,
and their default bindings in emacs mode,
vi command mode and vi insert mode
(the `\fBemacs\fP', `\fBvicmd\fP' and `\fBviins\fP' keymaps, respectively)\&.
.PP
Note that cursor keys are bound to movement keys in all three keymaps;
the shell assumes that the cursor keys send the key sequences reported
by the terminal\-handling library (termcap or terminfo)\&.  The key sequences
shown in the list are those based on the VT100, common on many modern
terminals, but in fact these are not necessarily bound\&.  In the case of the
\fBviins\fP keymap, the initial escape character of the sequences serves also
to return to the \fBvicmd\fP keymap: whether this happens is determined by
the \fBKEYTIMEOUT\fP parameter, see \fIzshparam\fP(1)\&.
.SS "Movement"
.PD 0
.TP
.PD
\fBvi\-backward\-blank\-word\fP (unbound) (B) (unbound)
Move backward one word, where a word is defined as a series of
non\-blank characters\&.
.TP
\fBbackward\-char\fP (^B ESC\-[D) (unbound) (unbound)
Move backward one character\&.
.TP
\fBvi\-backward\-char\fP (unbound) (^H h ^?) (ESC\-[D)
Move backward one character, without changing lines\&.
.TP
\fBbackward\-word\fP (ESC\-B ESC\-b) (unbound) (unbound)
Move to the beginning of the previous word\&.
.TP
\fBemacs\-backward\-word\fP
Move to the beginning of the previous word\&.
.TP
\fBvi\-backward\-word\fP (unbound) (b) (unbound)
Move to the beginning of the previous word, vi\-style\&.
.TP
\fBbeginning\-of\-line\fP (^A) (unbound) (unbound)
Move to the beginning of the line\&.  If already at the beginning
of the line, move to the beginning of the previous line, if any\&.
.TP
\fBvi\-beginning\-of\-line\fP
Move to the beginning of the line, without changing lines\&.
.TP
\fBend\-of\-line\fP (^E) (unbound) (unbound)
Move to the end of the line\&.  If already at the end
of the line, move to the end of the next line, if any\&.
.TP
\fBvi\-end\-of\-line\fP (unbound) ($) (unbound)
Move to the end of the line\&.
If an argument is given to this command, the cursor will be moved to
the end of the line (argument \- 1) lines down\&.
.TP
\fBvi\-forward\-blank\-word\fP (unbound) (W) (unbound)
Move forward one word, where a word is defined as a series of
non\-blank characters\&.
.TP
\fBvi\-forward\-blank\-word\-end\fP (unbound) (E) (unbound)
Move to the end of the current word, or, if at the end of the current word,
to the end of the next word,
where a word is defined as a series of non\-blank characters\&.
.TP
\fBforward\-char\fP (^F ESC\-[C) (unbound) (unbound)
Move forward one character\&.
.TP
\fBvi\-forward\-char\fP (unbound) (space l) (ESC\-[C)
Move forward one character\&.
.TP
\fBvi\-find\-next\-char\fP (^X^F) (f) (unbound)
Read a character from the keyboard, and move to
the next occurrence of it in the line\&.
.TP
\fBvi\-find\-next\-char\-skip\fP (unbound) (t) (unbound)
Read a character from the keyboard, and move to
the position just before the next occurrence of it in the line\&.
.TP
\fBvi\-find\-prev\-char\fP (unbound) (F) (unbound)
Read a character from the keyboard, and move to
the previous occurrence of it in the line\&.
.TP
\fBvi\-find\-prev\-char\-skip\fP (unbound) (T) (unbound)
Read a character from the keyboard, and move to
the position just after the previous occurrence of it in the line\&.
.TP
\fBvi\-first\-non\-blank\fP (unbound) (^) (unbound)
Move to the first non\-blank character in the line\&.
.TP
\fBvi\-forward\-word\fP (unbound) (w) (unbound)
Move forward one word, vi\-style\&.
.TP
\fBforward\-word\fP (ESC\-F ESC\-f) (unbound) (unbound)
Move to the beginning of the next word\&.
The editor's idea of a word is specified with the \fBWORDCHARS\fP
parameter\&.
.TP
\fBemacs\-forward\-word\fP
Move to the end of the next word\&.
.TP
\fBvi\-forward\-word\-end\fP (unbound) (e) (unbound)
Move to the end of the next word\&.
.TP
\fBvi\-goto\-column\fP (ESC\-|) (|) (unbound)
Move to the column specified by the numeric argument\&.
.TP
\fBvi\-goto\-mark\fP (unbound) (`) (unbound)
Move to the specified mark\&.
.TP
\fBvi\-goto\-mark\-line\fP (unbound) (') (unbound)
Move to beginning of the line containing the specified mark\&.
.TP
\fBvi\-repeat\-find\fP (unbound) (;) (unbound)
Repeat the last \fBvi\-find\fP command\&.
.TP
\fBvi\-rev\-repeat\-find\fP (unbound) (,) (unbound)
Repeat the last \fBvi\-find\fP command in the opposite direction\&.
.SS "History Control"
.PD 0
.TP
.PD
\fBbeginning\-of\-buffer\-or\-history\fP (ESC\-<) (unbound) (unbound)
Move to the beginning of the buffer, or if already there,
move to the first event in the history list\&.
.TP
\fBbeginning\-of\-line\-hist\fP
Move to the beginning of the line\&.  If already at the
beginning of the buffer, move to the previous history line\&.
.TP
\fBbeginning\-of\-history\fP
Move to the first event in the history list\&.
.TP
\fBdown\-line\-or\-history\fP (^N ESC\-[B) (j) (ESC\-[B)
Move down a line in the buffer, or if already at the bottom line,
move to the next event in the history list\&.
.TP
\fBvi\-down\-line\-or\-history\fP (unbound) (+) (unbound)
Move down a line in the buffer, or if already at the bottom line,
move to the next event in the history list\&.
Then move to the first non\-blank character on the line\&.
.TP
\fBdown\-line\-or\-search\fP
Move down a line in the buffer, or if already at the bottom line,
search forward in the history for a line beginning with the first
word in the buffer\&.
.RS
.PP
If called from a function by the \fBzle\fP command with arguments, the first
argument is taken as the string for which to search, rather than the
first word in the buffer\&.
.RE
.TP
\fBdown\-history\fP (unbound) (^N) (unbound)
Move to the next event in the history list\&.
.TP
\fBhistory\-beginning\-search\-backward\fP
Search backward in the history for a line beginning with the current
line up to the cursor\&.
This leaves the cursor in its original position\&.
.TP
\fBend\-of\-buffer\-or\-history\fP (ESC\->) (unbound) (unbound)
Move to the end of the buffer, or if already there,
move to the last event in the history list\&.
.TP
\fBend\-of\-line\-hist\fP
Move to the end of the line\&.  If already at the end of
the buffer, move to the next history line\&.
.TP
\fBend\-of\-history\fP
Move to the last event in the history list\&.
.TP
\fBvi\-fetch\-history\fP (unbound) (G) (unbound)
Fetch the history line specified by the numeric argument\&.
This defaults to the current history line
(i\&.e\&. the one that isn't history yet)\&.
.TP
\fBhistory\-incremental\-search\-backward\fP (^R ^Xr) (unbound) (unbound)
Search backward incrementally for a specified string\&.  The search is
case\-insensitive if the search string does not have uppercase letters and no
numeric argument was given\&.  The string may begin with `\fB^\fP' to anchor the
search to the beginning of the line\&.
.RS
.PP
A restricted set of editing functions
is available in the mini\-buffer\&.  An interrupt signal, as defined by the stty
setting, will stop the search and go back to the original line\&.  An undefined
key will have the same effect\&. The supported functions are:
\fBbackward\-delete\-char\fP,
\fBvi\-backward\-delete\-char\fP,
\fBclear\-screen\fP,
\fBredisplay\fP,
\fBquoted\-insert\fP,
\fBvi\-quoted\-insert\fP,
\fBaccept\-and\-hold\fP,
\fBaccept\-and\-infer\-next\-history\fP,
\fBaccept\-line\fP and
\fBaccept\-line\-and\-down\-history\fP\&.
.PP
\fBmagic\-space\fP just inserts a space\&.
\fBvi\-cmd\-mode\fP toggles between the `\fBmain\fP' and `\fBvicmd\fP' keymaps;
the `\fBmain\fP' keymap (insert mode) will be selected initially\&.
\fBhistory\-incremental\-search\-backward\fP will get the
next occurrence of the contents of the mini\-buffer\&.
\fBhistory\-incremental\-search\-forward\fP inverts the sense of the search\&.
\fBvi\-repeat\-search\fP and \fBvi\-rev\-repeat\-search\fP are similarly supported\&.
The direction of the search is indicated in the mini\-buffer\&.
.PP
Any multi\-character string
that is not bound to one of the above functions will beep and interrupt the
search, leaving the last found line in the buffer\&. Any single character that
is not bound to one of the above functions, or \fBself\-insert\fP or
\fBself\-insert\-unmeta\fP, will have the same effect but the function will be
executed\&.
.PP
When called from a widget function by the \fBzle\fP command, the incremental
search commands can take a string argument\&.  This will be treated as a
string of keys, as for arguments to the \fBbindkey\fP command, and used as
initial input for the command\&.  Any characters in the string which are
unused by the incremental search will be silently ignored\&.  For example,
.PP
.RS
.nf
\fBzle history\-incremental\-search\-backward forceps\fP
.fi
.RE
.PP
will search backwards for \fBforceps\fP, leaving the minibuffer containing
the string `\fBforceps\fP'\&.
.RE
.TP
\fBhistory\-incremental\-search\-forward\fP (^S ^Xs) (unbound) (unbound)
Search forward incrementally for a specified string\&.  The search is
case\-insensitive if the search string does not have uppercase letters and no
numeric argument was given\&.  The string may begin with `\fB^\fP' to anchor the
search to the beginning of the line\&.  The functions available in the
mini\-buffer are the same as for \fBhistory\-incremental\-search\-backward\fP\&.
.TP
\fBhistory\-search\-backward\fP (ESC\-P ESC\-p) (unbound) (unbound)
Search backward in the history for a line beginning with the first
word in the buffer\&.
.RS
.PP
If called from a function by the \fBzle\fP command with arguments, the first
argument is taken as the string for which to search, rather than the
first word in the buffer\&.
.RE
.TP
\fBvi\-history\-search\-backward\fP (unbound) (/) (unbound)
Search backward in the history for a specified string\&.
The string may begin with `\fB^\fP' to anchor the search to the
beginning of the line\&.
.RS
.PP
A restricted set of editing functions is available in
the mini\-buffer\&.  An interrupt signal, as defined by the stty setting,  will
stop the search\&.
The functions available in the mini\-buffer are:
\fBaccept\-line\fP,
\fBbackward\-delete\-char\fP,
\fBvi\-backward\-delete\-char\fP,
\fBbackward\-kill\-word\fP,
\fBvi\-backward\-kill\-word\fP,
\fBclear\-screen\fP,
\fBredisplay\fP,
\fBquoted\-insert\fP
and
\fBvi\-quoted\-insert\fP\&.
.PP
\fBvi\-cmd\-mode\fP is treated the same as accept\-line, and
\fBmagic\-space\fP is treated as a space\&.
Any other character that is not bound to self\-insert or
self\-insert\-unmeta will beep and be ignored\&. If the function is called from vi
command mode, the bindings of the current insert mode will be used\&.
.PP
If called from a function by the \fBzle\fP command with arguments, the first
argument is taken as the string for which to search, rather than the
first word in the buffer\&.
.RE
.TP
\fBhistory\-search\-forward\fP (ESC\-N ESC\-n) (unbound) (unbound)
Search forward in the history for a line beginning with the first
word in the buffer\&.
.RS
.PP
If called from a function by the \fBzle\fP command with arguments, the first
argument is taken as the string for which to search, rather than the
first word in the buffer\&.
.RE
.TP
\fBvi\-history\-search\-forward\fP (unbound) (?) (unbound)
Search forward in the history for a specified string\&.
The string may begin with `\fB^\fP' to anchor the search to the
beginning of the line\&. The functions available in the mini\-buffer are the same
as for \fBvi\-history\-search\-backward\fP\&.  Argument handling is also the same
as for that command\&.
.TP
\fBinfer\-next\-history\fP (^X^N) (unbound) (unbound)
Search in the history list for a line matching the current one and
fetch the event following it\&.
.TP
\fBinsert\-last\-word\fP (ESC\-_ ESC\-\&.) (unbound) (unbound)
Insert the last word from the previous history event at the
cursor position\&.  If a positive numeric argument is given,
insert that word from the end of the previous history event\&.
If the argument is zero or negative insert that word from the
left (zero inserts the previous command word)\&.  Repeating this command
replaces the word just inserted with the last word from the
history event prior to the one just used; numeric arguments can be used in
the same way to pick a word from that event\&.
.RS
.PP
When called from a shell function invoked from a user\-defined widget, the
command can take one to three arguments\&.  The first argument specifies a
history offset which applies to successive calls to this widget: if is \-1,
the default behaviour is used, while if it is 1, successive calls will move
forwards through the history\&.  The value 0 can be used to indicate that the
history line examined by the previous execution of the command will be
reexamined\&.  Note that negative numbers should be preceded with a
`\fB\-\fP\fB\-\fP' argument to avoid confusing them with options\&.
.PP
If two arguments are given, the second specifies the word on the command
line in normal array index notation (as a more natural alternative to the
prefix argument)\&.  Hence 1 is the first word, and \-1 (the default) is the
last word\&.
.PP
If a third argument is given, its value is ignored, but it is used to
signify that the history offset is relative to the current history line,
rather than the one remembered after the previous invocations of
\fBinsert\-last\-word\fP\&.
.PP
For example, the default behaviour of the command corresponds to
.PP
.RS
.nf
\fBzle insert\-last\-word \-\- \-1 \-1\fP
.fi
.RE
.PP
while the command
.PP
.RS
.nf
\fBzle insert\-last\-word \-\- \-1 1 \-\fP
.fi
.RE
.PP
always copies the first word of the line in the history immediately before
the line being edited\&.  This has the side effect that later invocations of
the widget will be relative to that line\&.
.RE
.TP
\fBvi\-repeat\-search\fP (unbound) (n) (unbound)
Repeat the last vi history search\&.
.TP
\fBvi\-rev\-repeat\-search\fP (unbound) (N) (unbound)
Repeat the last vi history search, but in reverse\&.
.TP
\fBup\-line\-or\-history\fP (^P ESC\-[A) (k) (ESC\-[A)
Move up a line in the buffer, or if already at the top line,
move to the previous event in the history list\&.
.TP
\fBvi\-up\-line\-or\-history\fP (unbound) (\-) (unbound)
Move up a line in the buffer, or if already at the top line,
move to the previous event in the history list\&.
Then move to the first non\-blank character on the line\&.
.TP
\fBup\-line\-or\-search\fP
Move up a line in the buffer, or if already at the top line,
search backward in the history for a line beginning with the
first word in the buffer\&.
.RS
.PP
If called from a function by the \fBzle\fP command with arguments, the first
argument is taken as the string for which to search, rather than the
first word in the buffer\&.
.RE
.TP
\fBup\-history\fP (unbound) (^P) (unbound)
Move to the previous event in the history list\&.
.TP
\fBhistory\-beginning\-search\-forward\fP
Search forward in the history for a line beginning with the current
line up to the cursor\&.
This leaves the cursor in its original position\&.
.SS "Modifying Text"
.PD 0
.TP
.PD
\fBvi\-add\-eol\fP (unbound) (A) (unbound)
Move to the end of the line and enter insert mode\&.
.TP
\fBvi\-add\-next\fP (unbound) (a) (unbound)
Enter insert mode after the current cursor position, without changing lines\&.
.TP
\fBbackward\-delete\-char\fP (^H ^?) (unbound) (unbound)
Delete the character behind the cursor\&.
.TP
\fBvi\-backward\-delete\-char\fP (unbound) (X) (^H)
Delete the character behind the cursor, without changing lines\&.
If in insert mode, this won't delete past the point where insert mode was
last entered\&.
.TP
\fBbackward\-delete\-word\fP
Delete the word behind the cursor\&.
.TP
\fBbackward\-kill\-line\fP
Kill from the beginning of the line to the cursor position\&.
.TP
\fBbackward\-kill\-word\fP (^W ESC\-^H ESC\-^?) (unbound) (unbound)
Kill the word behind the cursor\&.
.TP
\fBvi\-backward\-kill\-word\fP (unbound) (unbound) (^W)
Kill the word behind the cursor, without going past the point where insert
mode was last entered\&.
.TP
\fBcapitalize\-word\fP (ESC\-C ESC\-c) (unbound) (unbound)
Capitalize the current word and move past it\&.
.TP
\fBvi\-change\fP (unbound) (c) (unbound)
Read a movement command from the keyboard, and kill
from the cursor position to the endpoint of the movement\&.
Then enter insert mode\&.
If the command is \fBvi\-change\fP, change the current line\&.
.TP
\fBvi\-change\-eol\fP (unbound) (C) (unbound)
Kill to the end of the line and enter insert mode\&.
.TP
\fBvi\-change\-whole\-line\fP (unbound) (S) (unbound)
Kill the current line and enter insert mode\&.
.TP
\fBcopy\-region\-as\-kill\fP (ESC\-W ESC\-w) (unbound) (unbound)
Copy the area from the cursor to the mark to the kill buffer\&.
.TP
\fBcopy\-prev\-word\fP (ESC\-^_) (unbound) (unbound)
Duplicate the word to the left of the cursor\&.
.TP
\fBcopy\-prev\-shell\-word\fP
Like \fBcopy\-prev\-word\fP, but the word is found by using shell parsing, 
whereas \fBcopy\-prev\-word\fP looks for blanks\&. This makes a difference
when the word is quoted and contains spaces\&.
.TP
\fBvi\-delete\fP (unbound) (d) (unbound)
Read a movement command from the keyboard, and kill
from the cursor position to the endpoint of the movement\&.
If the command is \fBvi\-delete\fP, kill the current line\&.
.TP
\fBdelete\-char\fP
Delete the character under the cursor\&.
.TP
\fBvi\-delete\-char\fP (unbound) (x) (unbound)
Delete the character under the cursor,
without going past the end of the line\&.
.TP
\fBdelete\-word\fP
Delete the current word\&.
.TP
\fBdown\-case\-word\fP (ESC\-L ESC\-l) (unbound) (unbound)
Convert the current word to all lowercase and move past it\&.
.TP
\fBkill\-word\fP (ESC\-D ESC\-d) (unbound) (unbound)
Kill the current word\&.
.TP
\fBgosmacs\-transpose\-chars\fP
Exchange the two characters behind the cursor\&.
.TP
\fBvi\-indent\fP (unbound) (>) (unbound)
Indent a number of lines\&.
.TP
\fBvi\-insert\fP (unbound) (i) (unbound)
Enter insert mode\&.
.TP
\fBvi\-insert\-bol\fP (unbound) (I) (unbound)
Move to the first non\-blank character on the line and enter insert mode\&.
.TP
\fBvi\-join\fP (^X^J) (J) (unbound)
Join the current line with the next one\&.
.TP
\fBkill\-line\fP (^K) (unbound) (unbound)
Kill from the cursor to the end of the line\&.
If already on the end of the line, kill the newline character\&.
.TP
\fBvi\-kill\-line\fP (unbound) (unbound) (^U)
Kill from the cursor back to wherever insert mode was last entered\&.
.TP
\fBvi\-kill\-eol\fP (unbound) (D) (unbound)
Kill from the cursor to the end of the line\&.
.TP
\fBkill\-region\fP
Kill from the cursor to the mark\&.
.TP
\fBkill\-buffer\fP (^X^K) (unbound) (unbound)
Kill the entire buffer\&.
.TP
\fBkill\-whole\-line\fP (^U) (unbound) (unbound)
Kill the current line\&.
.TP
\fBvi\-match\-bracket\fP (^X^B) (%) (unbound)
Move to the bracket character (one of \fB{}\fP, \fB()\fP or \fB[]\fP) that
matches the one under the cursor\&.
If the cursor is not on a bracket character, move forward without going
past the end of the line to find one, and then go to the matching bracket\&.
.TP
\fBvi\-open\-line\-above\fP (unbound) (O) (unbound)
Open a line above the cursor and enter insert mode\&.
.TP
\fBvi\-open\-line\-below\fP (unbound) (o) (unbound)
Open a line below the cursor and enter insert mode\&.
.TP
\fBvi\-oper\-swap\-case\fP
Read a movement command from the keyboard, and swap
the case of all characters
from the cursor position to the endpoint of the movement\&.
If the movement command is \fBvi\-oper\-swap\-case\fP,
swap the case of all characters on the current line\&.
.TP
\fBoverwrite\-mode\fP (^X^O) (unbound) (unbound)
Toggle between overwrite mode and insert mode\&.
.TP
\fBvi\-put\-before\fP (unbound) (P) (unbound)
Insert the contents of the kill buffer before the cursor\&.
If the kill buffer contains a sequence of lines (as opposed to characters),
paste it above the current line\&.
.TP
\fBvi\-put\-after\fP (unbound) (p) (unbound)
Insert the contents of the kill buffer after the cursor\&.
If the kill buffer contains a sequence of lines (as opposed to characters),
paste it below the current line\&.
.TP
\fBquoted\-insert\fP (^V) (unbound) (unbound)
Insert the next character typed into the buffer literally\&.
An interrupt character will not be inserted\&.
.TP
\fBvi\-quoted\-insert\fP (unbound) (unbound) (^Q ^V)
Display a `\fB^\fP' at the cursor position, and
insert the next character typed into the buffer literally\&.
An interrupt character will not be inserted\&.
.TP
\fBquote\-line\fP (ESC\-') (unbound) (unbound)
Quote the current line; that is, put a `\fB'\fP' character at the
beginning and the end, and convert all `\fB'\fP' characters
to `\fB'\e''\fP'\&.
.TP
\fBquote\-region\fP (ESC\-") (unbound) (unbound)
Quote the region from the cursor to the mark\&.
.TP
\fBvi\-replace\fP (unbound) (R) (unbound)
Enter overwrite mode\&.
.TP
\fBvi\-repeat\-change\fP (unbound) (\&.) (unbound)
Repeat the last vi mode text modification\&.
If a count was used with the modification, it is remembered\&.
If a count is given to this command, it overrides the remembered count,
and is remembered for future uses of this command\&.
The cut buffer specification is similarly remembered\&.
.TP
\fBvi\-replace\-chars\fP (unbound) (r) (unbound)
Replace the character under the cursor with a character
read from the keyboard\&.
.TP
\fBself\-insert\fP (printable characters) (unbound) (printable characters and some control characters)
Insert a character into the buffer at the cursor position\&.
.TP
\fBself\-insert\-unmeta\fP (ESC\-^I ESC\-^J ESC\-^M) (unbound) (unbound)
Insert a character into the buffer after stripping the meta bit
and converting ^M to ^J\&.
.TP
\fBvi\-substitute\fP (unbound) (s) (unbound)
Substitute the next character(s)\&.
.TP
\fBvi\-swap\-case\fP (unbound) (~) (unbound)
Swap the case of the character under the cursor and move past it\&.
.TP
\fBtranspose\-chars\fP (^T) (unbound) (unbound)
Exchange the two characters to the left of the
cursor if at end of line, else exchange the
character under the cursor with the character
to the left\&.
.TP
\fBtranspose\-words\fP (ESC\-T ESC\-t) (unbound) (unbound)
Exchange the current word with the one before it\&.
.TP
\fBvi\-unindent\fP (unbound) (<) (unbound)
Unindent a number of lines\&.
.TP
\fBup\-case\-word\fP (ESC\-U ESC\-u) (unbound) (unbound)
Convert the current word to all caps and move past it\&.
.TP
\fByank\fP (^Y) (unbound) (unbound)
Insert the contents of the kill buffer at the cursor position\&.
.TP
\fByank\-pop\fP (ESC\-y) (unbound) (unbound)
Remove the text just yanked, rotate the kill\-ring,
and yank the new top\&.  Only works following
\fByank\fP or \fByank\-pop\fP\&.
.TP
\fBvi\-yank\fP (unbound) (y) (unbound)
Read a movement command from the keyboard, and copy the region
from the cursor position to the endpoint of the movement
into the kill buffer\&.
If the command is \fBvi\-yank\fP, copy the current line\&.
.TP
\fBvi\-yank\-whole\-line\fP (unbound) (Y) (unbound)
Copy the current line into the kill buffer\&.
.TP
\fBvi\-yank\-eol\fP
Copy the region from the cursor position to the end of the line
into the kill buffer\&.
Arguably, this is what Y should do in vi, but it isn't what it actually does\&.
.SS "Arguments"
.PD 0
.TP
.PD
\fBdigit\-argument\fP (ESC\-0\&.\&.ESC\-9) (1\-9) (unbound)
Start a new numeric argument, or add to the current one\&.
See also \fBvi\-digit\-or\-beginning\-of\-line\fP\&.  This only works if bound to a
key sequence ending in a decimal digit\&.
.RS
.PP
Inside a widget function, a call to this function treats the last key of
the key sequence which called the widget as the digit\&.
.RE
.TP
\fBneg\-argument\fP (ESC\-\-) (unbound) (unbound)
Changes the sign of the following argument\&.
.TP
\fBuniversal\-argument\fP
Multiply the argument of the next command by 4\&.  Alternatively, if
this command is followed by an integer (positive or negative), use
that as the argument for the next command\&.  Thus digits cannot be
repeated using this command\&.  For example, if this command occurs
twice, followed immediately by \fBforward\-char\fP, move forward sixteen
spaces; if instead it is followed by \fB\-2\fP, then \fBforward\-char\fP,
move backward two spaces\&.
.RS
.PP
Inside a widget function, if passed an argument, i\&.e\&. `\fBzle
universal\-argument\fP \fInum\fP', the numerical argument will be set to
\fInum\fP; this is equivalent to `\fBNUMERIC=\fP\fInum\fP'\&.
.RE
.RE
.SS "Completion"
.PD 0
.TP
.PD
\fBaccept\-and\-menu\-complete\fP
In a menu completion, insert the current completion into the buffer,
and advance to the next possible completion\&.
.TP
\fBcomplete\-word\fP
Attempt completion on the current word\&.
.TP
\fBdelete\-char\-or\-list\fP (^D) (unbound) (unbound)
Delete the character under the cursor\&.  If the cursor
is at the end of the line, list possible completions for the
current word\&.
.TP
\fBexpand\-cmd\-path\fP
Expand the current command to its full pathname\&.
.TP
\fBexpand\-or\-complete\fP (TAB) (unbound) (TAB)
Attempt shell expansion on the current word\&.
If that fails,
attempt completion\&.
.TP
\fBexpand\-or\-complete\-prefix\fP
Attempt shell expansion on the current word up to cursor\&.
.TP
\fBexpand\-history\fP (ESC\-space ESC\-!) (unbound) (unbound)
Perform history expansion on the edit buffer\&.
.TP
\fBexpand\-word\fP (^X*) (unbound) (unbound)
Attempt shell expansion on the current word\&.
.TP
\fBlist\-choices\fP (ESC\-^D) (^D =) (^D)
List possible completions for the current word\&.
.TP
\fBlist\-expand\fP (^Xg ^XG) (^G) (^G)
List the expansion of the current word\&.
.TP
\fBmagic\-space\fP
Perform history expansion and insert a space into the
buffer\&.  This is intended to be bound to space\&.
.TP
\fBmenu\-complete\fP
Like \fBcomplete\-word\fP, except that menu completion is used\&.
See the \fBMENU_COMPLETE\fP option\&.
.TP
\fBmenu\-expand\-or\-complete\fP
Like \fBexpand\-or\-complete\fP, except that menu completion is used\&.
.TP
\fBreverse\-menu\-complete\fP
Perform menu completion, like \fBmenu\-complete\fP, except that if
a menu completion is already in progress, move to the \fIprevious\fP
completion rather than the next\&.
.TP
\fBend\-of\-list\fP
When a previous completion displayed a list below the prompt, this
widget can be used to move the prompt below the list\&.
.SS "Miscellaneous"
.PD 0
.TP
.PD
\fBaccept\-and\-hold\fP (ESC\-A ESC\-a) (unbound) (unbound)
Push the contents of the buffer on the buffer stack
and execute it\&.
.TP
\fBaccept\-and\-infer\-next\-history\fP
Execute the contents of the buffer\&.
Then search the history list for a line matching the current one
and push the event following onto the buffer stack\&.
.TP
\fBaccept\-line\fP (^J ^M) (^J ^M) (^J ^M)
Finish editing the buffer\&.  Normally this causes the buffer to be
executed as a shell command\&.
.TP
\fBaccept\-line\-and\-down\-history\fP (^O) (unbound) (unbound)
Execute the current line, and push the next history
event on the the buffer stack\&.
.TP
\fBbeep\fP
Beep, unless the \fBBEEP\fP option is unset\&.
.TP
\fBvi\-cmd\-mode\fP (^X^V) (unbound) (^[)
Enter command mode; that is, select the `\fBvicmd\fP' keymap\&.
Yes, this is bound by default in emacs mode\&.
.TP
\fBvi\-caps\-lock\-panic\fP
Hang until any lowercase key is pressed\&.
This is for vi users without the mental capacity to keep
track of their caps lock key (like the author)\&.
.TP
\fBclear\-screen\fP (^L ESC\-^L) (^L) (^L)
Clear the screen and redraw the prompt\&.
.TP
\fBdescribe\-key\-briefly\fP
Reads a key sequence, then prints the function bound to that sequence\&.
.TP
\fBexchange\-point\-and\-mark\fP (^X^X) (unbound) (unbound)
Exchange the cursor position with the position of the mark\&.
.TP
\fBexecute\-named\-cmd\fP (ESC\-x) (unbound) (unbound)
Read the name of an editor command and
execute it\&.  A restricted set of editing functions is available in the
mini\-buffer\&.  An interrupt signal, as defined by the stty setting, will
abort the function\&. The allowed functions are:
\fBbackward\-delete\-char\fP,
\fBvi\-backward\-delete\-char\fP,
\fBclear\-screen\fP,
\fBredisplay\fP,
\fBquoted\-insert\fP,
\fBvi\-quoted\-insert\fP,
\fBbackward\-kill\-word\fP,
\fBvi\-backward\-kill\-word\fP,
\fBkill\-whole\-line\fP,
\fBvi\-kill\-line\fP,
\fBbackward\-kill\-line\fP,
\fBlist\-choices\fP,
\fBdelete\-char\-or\-list\fP,
\fBcomplete\-word\fP,
\fBaccept\-line\fP,
\fBexpand\-or\-complete\fP and
\fBexpand\-or\-complete\-prefix\fP\&.
.RS
.PP
\fBkill\-region\fP kills the last word,
and vi\-cmd\-mode is treated the same as accept\-line\&.
The space and tab characters, if not bound to one of
these functions, will complete the name and then list the
possibilities if the \fBAUTO_LIST\fP option is set\&.
Any other character that is not bound to \fBself\-insert\fP or
\fBself\-insert\-unmeta\fP will beep and be ignored\&.
The bindings of the current insert mode will be used\&.
.RE
.TP
\fBexecute\-last\-named\-cmd\fP (ESC\-z) (unbound) (unbound)
Redo the last function executed with \fBexecute\-named\-cmd\fP\&.
.TP
\fBget\-line\fP (ESC\-G ESC\-g) (unbound) (unbound)
Pop the top line off the buffer stack and insert it at the
cursor position\&.
.TP
\fBpound\-insert\fP (unbound) (#) (unbound)
If there is no # character at the beginning of the buffer,
add one to the beginning of each line\&.
If there is one, remove a # from each line that has one\&.
In either case, accept the current line\&.
The \fBINTERACTIVE_COMMENTS\fP option must be set
for this to have any usefulness\&.
.TP
\fBvi\-pound\-insert\fP
If there is no # character at the beginning of the current line,
add one\&.  If there is one, remove it\&.
The \fBINTERACTIVE_COMMENTS\fP option must be set
for this to have any usefulness\&.
.TP
\fBpush\-input\fP
Push the entire current multiline construct onto the buffer stack and
return to the top\-level (\fBPS1\fP) prompt\&.
If the current parser construct is only a single line, this is exactly
like \fBpush\-line\fP\&.
Next time the editor starts up or is popped with \fBget\-line\fP, the
construct will be popped off the top of the buffer stack and loaded
into the editing buffer\&.
.TP
\fBpush\-line\fP (^Q ESC\-Q ESC\-q) (unbound) (unbound)
Push the current buffer onto the buffer stack and clear
the buffer\&.
Next time the editor starts up, the buffer will be popped
off the top of the buffer stack and loaded into the editing
buffer\&.
.TP
\fBpush\-line\-or\-edit\fP
At the top\-level (\fBPS1\fP) prompt, equivalent to \fBpush\-line\fP\&.
At a secondary (\fBPS2\fP) prompt, move the entire current multiline
construct into the editor buffer\&.
The latter is equivalent to \fBpush\-input\fP followed by \fBget\-line\fP\&.
.TP
\fBrecursive\-edit\fP
Only useful from a user\-defined widget\&.  At this point in the function,
the editor regains control until one of the standard widgets which would
normally cause zle to exit (typically an \fBaccept\-line\fP caused by
hitting the return key) is executed\&.  Instead, control returns to the
user\-defined widget\&.  The status returned is non\-zero if the return was
caused by an error, but the function still continues executing and hence
may tidy up\&.  This makes it safe for the user\-defined widget to alter
the command line or key bindings temporarily\&.
.RS
.PP
The following widget, \fBcaps\-lock\fP, serves as an example\&.
.RS
.nf
\fBself\-insert\-ucase() {
  LBUFFER+=${(U)KEYS[\-1]}
}
.PP
integer stat
.PP
zle \-N self\-insert self\-insert\-ucase
zle \-A caps\-lock save\-caps\-lock
zle \-A accept\-line caps\-lock
.PP
zle recursive\-edit
stat=$?
.PP
zle \-A \&.self\-insert self\-insert
zle \-A save\-caps\-lock caps\-lock
zle \-D save\-caps\-lock
.PP
(( stat )) && zle send\-break
.PP
return $stat
\fP
.fi
.RE
This causes typed letters to be inserted capitalised until either
\fBaccept\-line\fP (i\&.e\&. typically the return key) is typed or the
\fBcaps\-lock\fP widget is invoked again; the later is handled by saving
the old definition of \fBcaps\-lock\fP as \fBsave\-caps\-lock\fP and then
rebinding it to invoke \fBaccept\-line\fP\&.  Note that an error from the
recursive edit is detected as a non\-zero return status and propagated by
using the \fBsend\-break\fP widget\&.
.RE
.TP
\fBredisplay\fP (unbound) (^R) (^R)
Redisplays the edit buffer\&.
.TP
\fBreset\-prompt\fP (unbound) (unbound) (unbound)
Force the prompts on both the left and right of the screen to be
re\-expanded, then redisplay the edit buffer\&.  This
reflects changes both to the prompt variables themselves and changes
in the expansion of the values (for example, changes in time or
directory, or changes to the value of variables referred to by the
prompt)\&.
.RS
.PP
Otherwise, the prompt is only expanded each time zle starts, and
when the display as been interrupted by output from another part of the
shell (such as a job notification) which causes the command line to be
reprinted\&.
.RE
.TP
\fBsend\-break\fP (^G ESC\-^G) (unbound) (unbound)
Abort the current editor function, e\&.g\&. \fBexecute\-named\-command\fP, or the
editor itself, e\&.g\&. if you are in \fBvared\fP\&. Otherwise abort the parsing of
the current line\&.
.TP
\fBrun\-help\fP (ESC\-H ESC\-h) (unbound) (unbound)
Push the buffer onto the buffer stack, and execute the
command `\fBrun\-help\fP \fIcmd\fP', where \fIcmd\fP is the current
command\&.  \fBrun\-help\fP is normally aliased to \fBman\fP\&.
.TP
\fBvi\-set\-buffer\fP (unbound) (") (unbound)
Specify a buffer to be used in the following command\&.
There are 35 buffers that can be specified:
the 26 `named' buffers \fB"a\fP to \fB"z\fP
and the nine `queued' buffers \fB"1\fP to \fB"9\fP\&.  The named buffers can also
be specified as \fB"A\fP to \fB"Z\fP\&.
.RS
.PP
When a buffer is specified for a cut command, the text being cut replaces
the previous contents of the specified buffer\&.  If a named buffer
is specified using a capital, the newly cut text is appended to the buffer
instead of overwriting it\&.
.PP
If no buffer is specified for a cut command, \fB"1\fP is used, and the
contents of \fB"1\fP to \fB"8\fP are each shifted along one buffer; the contents of
\fB"9\fP is lost\&.
.RE
.TP
\fBvi\-set\-mark\fP (unbound) (m) (unbound)
Set the specified mark at the cursor position\&.
.TP
\fBset\-mark\-command\fP (^@) (unbound) (unbound)
Set the mark at the cursor position\&.
.TP
\fBspell\-word\fP (ESC\-$ ESC\-S ESC\-s) (unbound) (unbound)
Attempt spelling correction on the current word\&.
.TP
\fBundefined\-key\fP
This command is executed when a key sequence that is not bound to any
command is typed\&.  By default it beeps\&.
.TP
\fBundo\fP (^_ ^Xu ^X^U) (unbound) (unbound)
Incrementally undo the last text modification\&.
.TP
\fBredo\fP
Incrementally redo undone text modifications\&.
.TP
\fBvi\-undo\-change\fP (unbound) (u) (unbound)
Undo the last text modification\&.
If repeated, redo the modification\&.
.TP
\fBwhat\-cursor\-position\fP (^X=) (unbound) (unbound)
Print the character under the cursor, its code as an octal, decimal and
hexadecimal number, the current cursor position within the buffer and the
column of the cursor in the current line\&.
.TP
\fBwhere\-is\fP
Read the name of an editor command and and print the listing of key
sequences that invoke the specified command\&.
.TP
\fBwhich\-command\fP (ESC\-?) (unbound) (unbound)
Push the buffer onto the buffer stack, and execute the
command `\fBwhich\-command\fP \fIcmd\fP'\&. where \fIcmd\fP is the current
command\&.  \fBwhich\-command\fP is normally aliased to \fIwhence\fP\&.
.TP
\fBvi\-digit\-or\-beginning\-of\-line\fP (unbound) (0) (unbound)
If the last command executed was a digit as part of an argument,
continue the argument\&.  Otherwise, execute vi\-beginning\-of\-line\&.