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
|
.\"
.\" Copyright (C) 1992, 93, 96, 97, 98, 99, 2001, 02 Free Software
.\" Foundation, Inc.
.\"
.\" Permission is granted to copy, distribute and/or modify this
.\" document under the terms of the GNU Free Documentation License,
.\" Version 1.1 or any later version published by the Free Software
.\" Foundation; with no Invariant Sections, with the Front-Cover texts
.\" being "A GNU Manual," and with the Back-Cover Texts as in (a)
.\" below. A copy of the license is included in the section entitled
.\" "GNU Free Documentation License."
.\"
.\" (a) The FSF's Back-Cover Text is: "You have freedom to copy and
.\" modify this GNU Manual, like GNU software. Copies published by
.\" the Free Software Foundation raise funds for GNU development."
.\"
.Dd February 15, 2003
.Dt INFOKEY 1
.Os
.Sh NAME
.Nm infokey
.Nd compile custom key bindings file
.Sh SYNOPSIS
.Nm infokey
.Op Fl -help
.Op Fl -version
.Op Fl -output Ar file
.Op Ar input file
.Sh DESCRIPTION
The
.Nm
utility compiles a source file
.Po Pa $HOME/.infokey
by default
.Pc
containing
.Xr info 1
customizations into a binary format
.Po Pa $HOME/.info
by default
.Pc .
.Xr info 1
reads the binary file at startup to override the
default key bindings and variable definitions.
.Pp
Besides the standard
.Fl -help
and
.Fl -version
options, the only option is
.Fl -output Ar file .
This tells
.Nm infokey
to write the binary data to
.Ar file
instead of
.Pa $HOME/.info .
.Pp
The format of the source file read by
.Nm
is most easily illustrated by example.
For instance, here is a sample
.Pa .infokey
source file suitable for aficionados of
.Xr vi 1
or
.Xr less 1 :
.Bd -literal -offset indent
#info
j next-line
k prev-line
l forward-char
h backward-char
\ekd next-line
\eku prev-line
\ekr forward-char
\ekl backward-char
\e scroll-forward
\ekD scroll-forward-page-only
b scroll-backward
\ekU scroll-backward-page-only
g beginning-of-node
\ekh beginning-of-node
G end-of-node
\eke end-of-node
\et select-reference-this-line
- history-node
n next-node
p prev-node
u up-node
t top-node
d dir-node
#var
scroll-step=1
.Ed
.Pp
The source file consists of one or more "sections".
Each section starts with a line that identifies the type of section.
Possible sections are:
.Bl -tag -width Ds
.It #info
Key bindings for
.Xr info 1
windows.
The start of this section is indicated by a line containing just `#info'
by itself.
If this is the first section in the source file,
the `#info' line can be omitted.
The rest of this section consists of lines of the form:
.Bd -literal -offset 3n
STRING whitespace ACTION [ whitespace [ # comment ] ] newline
.Ed
.Pp
Whitespace is any sequence of one or more spaces and/or tabs.
Comment is any sequence of any characters, excluding newline.
.Pp
STRING is the key sequence which invokes the action.
ACTION is the name of an
.Xr info 1
command.
The characters in STRING are interpreted literally or prefixed by a
caret (`^') to indicate a control character.
A backslash followed by certain characters specifies input keystrokes
as follows:
.Pp
.Bl -tag -width Ds -offset indent -compact
.It \eb
Backspace
.It \ee
Escape (ESC)
.It \en
Newline
.It \er
Return
.It \et
Tab
.It \eku
Up arrow
.It \ekd
Down arrow
.It \ekl
Left arrow
.It \ekr
Right arrow
.It \ekU
Page Up
.It \ekD
Page Down
.It \ekh
HOME
.It \eke
END
.It \ekx
Delete (DEL)
.It \emX
Meta-X, where X is any character as described above
.El
.Pp
Backslash followed by any other character indicates that character
is to be taken literally.
Characters which must be preceded by a backslash include
caret, space, tab, and backslash itself.
.It #echo-area
Key bindings for the echo area.
The start of this section is indicated by a line containing just
`#echo-area' by itself.
The rest of this section has a syntax identical to that for the key
definitions for the
.Xr info 1
area, described above.
.It #var
Variable initializations.
The start of this section is indicated by a line containing just `#var'
by itself.
Following this line is a list of variable assignments, one per line.
Each line consists of a variable name followed by `=',
followed by a value.
There may be no whitespace between the variable name and the `=',
and all characters following the `=',
including whitespace, are included in the value.
.El
.Pp
Blank lines and lines starting with `#' are ignored, except for the
special section header lines.
.Pp
Key bindings defined in the
.Pa .info
file take precedence over info's default key bindings, whether or not
.Cm --vi-keys
is used.
A default key binding may be disabled by overriding it in the
.Pa .info
file with the action `invalid'.
In addition,
.Em all
default key bindings can be disabled by adding this line
.Em anywhere
in the relevant section:
.Pp
.Dl #stop
.Pp
This will cause
.Xr info 1
to ignore all the default key commands for that section.
.Pp
.Sy Beware :
`#stop' can be dangerous.
Since it disables all default key bindings, you must supply enough new
key bindings to enable all necessary actions.
Failure to bind any key to the `quit' command, for example,
can lead to frustration.
.Pp
The order in which key bindings are defined in the
.Pa .info
file is not important, except that the command summary produced by the
`get-help-window' command only displays the
.Em first
key that is bound to each command.
.Sh FILES
.Bl -tag -width "$HOME/.infokeyXX" -compact
.It $HOME/.infokey
Default souce file for customizations.
.It $HOME/.info
Default binary file for customizations.
.El
.Sh SEE ALSO
.Xr info 1
.Sh BUGS
bug-texinfo@gnu.org
|