From bf984ecb9be286b81a3b2b2fb292f941357439d7 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 9 Mar 2023 16:14:44 +0100 Subject: [PATCH] docs: document the : thing for cursor positioning --- doc/nano.1 | 9 ++++++++- doc/nano.texi | 17 +++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/doc/nano.1 b/doc/nano.1 index 8fc40dff..fde6da75 100644 --- a/doc/nano.1 +++ b/doc/nano.1 @@ -25,6 +25,9 @@ nano \- Nano's ANOther editor, inspired by Pico .B nano .RI [ options "] [[\fB+" line [\fB, column "]] " file ]... .sp +.B nano +.RI [ options "] [" file [\fB: line [\fB: column "]]]..." +.sp .BR nano " [" \fIoptions "] [[" + [ crCR ]( / | ? ) \fIstring "] " \fIfile ]... .SH DESCRIPTION @@ -36,7 +39,11 @@ syntax coloring, line numbering, and soft-wrapping overlong lines. When giving a filename on the command line, the cursor can be put on a specific line by adding the line number with a plus sign (\fB+\fR) before the filename, and even in a specific column by adding it with a comma. -(Negative numbers count from the end of the file or line.) +Negative numbers count from the end of the file or line. +The line and column numbers may also be specified by gluing them with colons +after the filename. (When a filename contains a colon followed by digits, +escape the colon by preceding it with a triple backslash.) +.sp The cursor can be put on the first or last occurrence of a specific string by specifying that string after \fB+/\fR or \fB+?\fR before the filename. The string can be made case sensitive and/or caused to be interpreted as a diff --git a/doc/nano.texi b/doc/nano.texi index 8aca07b4..6ab23579 100644 --- a/doc/nano.texi +++ b/doc/nano.texi @@ -142,12 +142,17 @@ The usual way to invoke @command{nano} is: @blankline But it is also possible to specify one or more options (@pxref{Command-line Options}), -and to edit several files in a row. Additionally, the cursor -can be put on a specific line of a file by adding the line number -with a plus sign before the filename, and even in a specific column by -adding it with a comma. -(Negative numbers count from the end of the file or line.) -The cursor can also be put on the first or last occurrence of a specific string +and to edit several files in a row. + +The cursor can be put on a specific line of a file by adding +the line number with a plus sign before the filename, and even +in a specific column by adding it with a comma. +Negative numbers count from the end of the file or line. +The line and column numbers may also be specified by gluing them with colons +after the filename. (When a filename contains a colon followed by digits, +escape the colon by preceding it with a triple backslash.) + +The cursor can be put on the first or last occurrence of a specific string by specifying that string after @code{+/} or @code{+?} before the filename. The string can be made case sensitive and/or caused to be interpreted as a regular expression by inserting a @code{c} and/or @code{r} after the plus sign.