docs: explain what the options --stateflags (-%) and 'set stateflags' do

Also, colorize 'set stateflags' as valid option in a nanorc file.
master
Benno Schulenberg 2020-09-23 09:55:35 +02:00
parent 7ff6b97e5c
commit 844c671bf1
5 changed files with 38 additions and 1 deletions

View File

@ -95,6 +95,14 @@ The default key bindings can be changed via a \fInanorc\fR file -- see
.SH OPTIONS .SH OPTIONS
.TP .TP
.BR \-% ", " \-\-stateflags
Use the top-right corner of the screen for showing some state flags:
\fBI\fR when auto-indenting, \fBM\fR when the mark is on, \fBL\fR when
hard-wrapping (breaking long lines), \fBR\fR when recording a macro,
and \fBS\fR when soft-wrapping.
When the buffer is modified, a star (\fB*\fR) is shown after the
filename in the center of the title bar.
.TP
.BR \-A ", " \-\-smarthome .BR \-A ", " \-\-smarthome
Make the Home key smarter. When Home is pressed anywhere but at the Make the Home key smarter. When Home is pressed anywhere but at the
very beginning of non-whitespace characters on a line, the cursor will very beginning of non-whitespace characters on a line, the cursor will

View File

@ -165,6 +165,15 @@ a command straight into a buffer, and then edit it.
@table @option @table @option
@item -%
@itemx --stateflags
Use the top-right corner of the screen for showing some state flags:
@code{I} when auto-indenting, @code{M} when the mark is on, @code{L} when
hard-wrapping (breaking long lines), @code{R} when recording a macro,
and @code{S} when soft-wrapping.
When the buffer is modified, a star (@code{*}) is shown after the
filename in the center of the title bar.
@item -A @item -A
@itemx --smarthome @itemx --smarthome
Make the Home key smarter. When Home is pressed anywhere but at the Make the Home key smarter. When Home is pressed anywhere but at the
@ -1008,6 +1017,14 @@ the screen's edge, by using also @code{set atblanks}.)
Use the given program to do spell checking and correcting. Use the given program to do spell checking and correcting.
@xref{@option{--speller}} for details. @xref{@option{--speller}} for details.
@item set stateflags
Use the top-right corner of the screen for showing some state flags:
@code{I} when auto-indenting, @code{M} when the mark is on, @code{L} when
hard-wrapping (breaking long lines), @code{R} when recording a macro,
and @code{S} when soft-wrapping.
When the buffer is modified, a star (@code{*}) is shown after the
filename in the center of the title bar.
@item set statuscolor [bold,][italic,]@var{fgcolor},@var{bgcolor} @item set statuscolor [bold,][italic,]@var{fgcolor},@var{bgcolor}
Use this color combination for the status bar. Use this color combination for the status bar.
@xref{@code{set functioncolor}} for valid color names. @xref{@code{set functioncolor}} for valid color names.

View File

@ -294,6 +294,14 @@ the screen's edge, by using also \fBset atblanks\fR.)
Use the given \fIprogram\fR to do spell checking and correcting, instead of Use the given \fIprogram\fR to do spell checking and correcting, instead of
using the built-in corrector that calls \fBhunspell\fR(1) or \fBspell\fR(1). using the built-in corrector that calls \fBhunspell\fR(1) or \fBspell\fR(1).
.TP .TP
.B set stateflags
Use the top-right corner of the screen for showing some state flags:
\fBI\fR when auto-indenting, \fBM\fR when the mark is on, \fBL\fR when
hard-wrapping (breaking long lines), \fBR\fR when recording a macro,
and \fBS\fR when soft-wrapping.
When the buffer is modified, a star (\fB*\fR) is shown after the
filename in the center of the title bar.
.TP
.B set statuscolor \fR[\fBbold,\fR][\fBitalic,\fR]\fIfgcolor\fB,\fIbgcolor\fR .B set statuscolor \fR[\fBbold,\fR][\fBitalic,\fR]\fIfgcolor\fB,\fIbgcolor\fR
Specify the color combination to use for the status bar. Specify the color combination to use for the status bar.
See \fBset titlecolor\fR for more details. See \fBset titlecolor\fR for more details.

View File

@ -159,6 +159,10 @@
## does not have a default value. ## does not have a default value.
# set speller "aspell -x -c" # set speller "aspell -x -c"
## Use the end of the title bar for some state flags: I = auto-indenting,
## M = mark, L = hard-wrapping long lines, R = recording, S = soft-wrapping.
# set stateflags
## Allow nano to be suspended (with ^Z by default). ## Allow nano to be suspended (with ^Z by default).
# set suspendable # set suspendable
## (The old form of this option, 'set suspend', is deprecated.) ## (The old form of this option, 'set suspend', is deprecated.)

View File

@ -7,7 +7,7 @@ comment "#"
color brightred ".*" color brightred ".*"
# Keywords # Keywords
color brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(afterends|allow_insecure_backup|atblanks|autoindent|backup|boldtext|breaklonglines|casesensitive|constantshow|cutfromcursor|emptyline|historylog|indicator|jumpyscrolling|linenumbers|locking|mouse|multibuffer|noconvert|nohelp|nonewlines|positionlog|preserve|quickblank|rawsequences|rebinddelete|regexp|saveonexit|showcursor|smarthome|softwrap|suspendable|tabstospaces|trimblanks|unix|view|wordbounds|zap)\>" color brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(afterends|allow_insecure_backup|atblanks|autoindent|backup|boldtext|breaklonglines|casesensitive|constantshow|cutfromcursor|emptyline|historylog|indicator|jumpyscrolling|linenumbers|locking|mouse|multibuffer|noconvert|nohelp|nonewlines|positionlog|preserve|quickblank|rawsequences|rebinddelete|regexp|saveonexit|showcursor|smarthome|softwrap|stateflags|suspendable|tabstospaces|trimblanks|unix|view|wordbounds|zap)\>"
color yellow "^[[:space:]]*set[[:space:]]+((error|function|key|number|scroller|selected|status|stripe|title)color)[[:space:]]+(bold,)?(italic,)?(bright|light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte)?(,(light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte))?\>" color yellow "^[[:space:]]*set[[:space:]]+((error|function|key|number|scroller|selected|status|stripe|title)color)[[:space:]]+(bold,)?(italic,)?(bright|light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte)?(,(light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte))?\>"
color brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|errorcolor|functioncolor|keycolor|matchbrackets|numbercolor|operatingdir|punct|quotestr|scrollercolor|selectedcolor|speller|statuscolor|stripecolor|titlecolor|whitespace|wordchars)[[:space:]]+" color brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|errorcolor|functioncolor|keycolor|matchbrackets|numbercolor|operatingdir|punct|quotestr|scrollercolor|selectedcolor|speller|statuscolor|stripecolor|titlecolor|whitespace|wordchars)[[:space:]]+"
color brightgreen "^[[:space:]]*set[[:space:]]+(fill[[:space:]]+-?[[:digit:]]+|(guidestripe|tabsize)[[:space:]]+[1-9][0-9]*)\>" color brightgreen "^[[:space:]]*set[[:space:]]+(fill[[:space:]]+-?[[:digit:]]+|(guidestripe|tabsize)[[:space:]]+[1-9][0-9]*)\>"