docs: document the search-at-startup feature (+/string or +?string)

This commit is contained in:
Benno Schulenberg 2019-08-20 19:12:57 +02:00
parent bdf1a9d4e7
commit a06b921f12
2 changed files with 27 additions and 5 deletions

View File

@ -23,7 +23,9 @@ nano \- Nano's ANOther editor, inspired by Pico
.SH SYNOPSIS
.B nano
.RI [ options "] [[+" line [, column "]]\ " file "]..."
.RI [ options "] [[\fB+" line [\fB, column "]] " file ]...
.sp
.BR nano " [" \fIoptions "] [[" + [ crCR ]( / | ? ) \fIstring "] " \fIfile ]...
.SH NOTICE
Starting with version 4.0, \fBnano\fR no longer hard-wraps an overlong
@ -38,11 +40,23 @@ If you want the old, Pico behavior back, you can use \fB\-\-breaklonglines\fR,
of Pico, but is free software, and implements several features that Pico
lacks, such as: opening multiple files, scrolling per line, undo/redo,
syntax coloring, line numbering, and soft-wrapping overlong lines.
.sp
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.
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
regular expression by inserting \fBc\fR and/or \fBr\fR after the \fB+\fR sign.
These search modes can be explicitly disabled by using the uppercase variant
of those letters: \fBC\fR and/or \fBR\fR. When the string contains spaces,
it needs to be enclosed in quotes. To give an example: to open a file at
the first occurrence of the word "Foo", one would do:
.sp
.RS 4
.BI "nano +c/Foo " file
.RE
.sp
As a special case: if instead of a filename a dash (\fB\-\fR) is given,
\fBnano\fR will read data from standard input.

View File

@ -127,13 +127,21 @@ But it is also possible to specify one or more options (see the next
section), 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. So a more complete command synopsis is:
adding it with a comma.
The cursor can also 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.
These search modes can be explicitly disabled by using the uppercase variant
of those letters: @code{C} and/or @code{R}. When the string contains spaces,
it needs to be enclosed in quotes.
A more complete command synopsis thus is:
@iftex
@sp 1
@end iftex
@example
@code{nano [OPTION]@dots{} [[+LINE[,COLUMN]|+,COLUMN] FILE]@dots{}}
@code{nano [OPTION]@dots{} [[+LINE[,COLUMN]|+[crCR](/|?)STRING] FILE]@dots{}}
@end example
@iftex
@sp 1