commit 7f88eff96f60b2b885a922b39f814804fceb161d
parent 3b8c8988806615f43d14d0b338e3b9394d17850f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 27 Feb 2018 20:11:17 +0100
docs: mention that a key can be bound to a string
Diffstat:
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/doc/nano.texi b/doc/nano.texi
@@ -1041,7 +1041,7 @@ in one of the system-installed files (which normally are not writable).
@node Rebinding Keys
@section Rebinding Keys
-Key bindings can be changed via the following two commands in a
+Key bindings can be changed via the following three commands in a
nanorc file:
@table @code
@@ -1050,6 +1050,13 @@ nanorc file:
Rebinds @code{key} to @code{function} in the context of @code{menu}
(or in all menus where the function exists by using @code{all}).
+@item bind key "string" menu
+Makes @code{key} produce @code{string} in the context of @code{menu}
+(or in all menus where the key exists when @code{all} is used).
+The @code{string} can consist of text or commands or a mix of them.
+(To enter a command into the @code{string}, precede its keystroke
+with @kbd{M-V}.)
+
@item unbind key menu
Unbinds @code{key} from @code{menu}
(or from all menus where it exists by using @code{all}).
diff --git a/doc/nanorc.5 b/doc/nanorc.5
@@ -395,16 +395,26 @@ slightly improve a syntax defined in one of the system-installed
files (which normally are not writable).
.SH REBINDING KEYS
-Key bindings can be changed via the following two commands:
+Key bindings can be changed via the following three commands:
+.RS 3
.TP
.BI bind " key function menu"
Rebinds the key \fIkey\fP to a new function named \fIfunction\fP in the
context of menu \fImenu\fP (or in all menus where the function exists
by using \fBall\fP).
.TP
+.BI bind " key " """" string """" " menu"
+Makes the given \fIkey\fR produce the given \fIstring\fR in the given
+\fImenu\fR (or in all menus where the key exists when \fBall\fR is used).
+The \fIstring\fR can consist of text or commands or a mix of them.
+(To enter a command into the \fIstring\fR, precede its keystroke
+with \fBM-V\fR.)
+
+.TP
.BI unbind " key menu"
Unbinds the key \fIkey\fP from the menu named \fImenu\fP (or from all
menus where it exists by using \fBall\fP).
+.RE
.TP
The format of \fIkey\fP should be one of: