.TH smenu 1 "2015" "beta"
.SH NAME
smenu - filter that allows one to interactively select a word from stdin
and outputs the selection to stdout.
.SH SYNOPSIS
.nf
\f(CRsmenu [\fB-h\fP|\fB-?\fP] [\fB-f\fP \fIconfiguration_file\fP] \\
[\fB-n\fP [\fIlines\fP]] [\fB-t\fP [\fIcols\fP]] [\fB-k\fP] \\
[\fB-s\fP \fIpattern\fP] [\fB-m\fP \fImessage\fP] [\fB-w\fP] \\
[\fB-d\fP] [\fB-M\fP] [\fB-c\fP] [\fB-l\fP] [\fB-r\fP] [\fB-b\fP] \\
[\fB-a\fP \
(i|e|c|b|si|m|t|ct|sf|st|mf|mt|sfe|ste|mfe|mte|da):\fIATTR\fP]... \\
[\fB-i\fP \fIregex\fP] [\fB-e\fP \fIregex\fP] \\
[\fB-C\fP \
[\fIi\fP|\fIe\fP]<col selectors>] \\
[\fB-R\fP \
[\fIi\fP|\fIe\fP]<row selectors>] \\
[\fB-S\fP \fI/regex/string/\fP[\fIg\fP][\fIv\fP][\fIs\fP][\fIi\fP]] \\
[\fB-I\fP \fI/regex/string/\fP[\fIg\fP][\fIv\fP][\fIs\fP][\fIi\fP]] \\
[\fB-E\fP \fI/regex/string/\fP[\fIg\fP][\fIv\fP][\fIs\fP][\fIi\fP]] \\
[\fB-A\fP \fIregex\fP] [\fB-Z\fP \fIregex\fP] \\
[\fB-N\fP [\fIregex\fP]] [\fB-U\fP [\fIregex\fP]] [\fB-F\fP] \
[\fB-D\fP \fIsub-option\fP...] \\
[\fB-1\fP \fIregex\fP [\fIATTR\fP]] \
[\fB-2\fP \fIregex\fP [\fIATTR\fP]] ... \
[\fB-5\fP \fIregex\fP [\fIATTR\fP]] \\
[\fB-g\fP [\fIstring\fP]] [\fB-q\fP] \
[\fB-W\fP \fIbytes\fP] [\fB-L\fP \fIbytes\fP] \\
[\fB-T\fP [\fIseparator\fP]] [\fB-P\fP [\fIseparator\fP]] [\fB-p\fP] \\
[\fB-V\fP] [\fB-x\fP|\fB-X\fP \fItype\fP [\fIword\fP] \fIdelay\fP] \
[\fB-/\fP \fIprefix\fP|\fIsubstring\fP|\fIfuzzy\fP] \\
[input_file]
<col selectors> ::= \fIcol1\fP[-\fIcol2\fP],...|\fI<RE>\fP,...
<row selectors> ::= \fIcol1\fP[-\fIcol2\fP],...|\fI<RE>\fP,...
<sub-option> ::= [l|r:<char>]|[a:left|right]|[p:included|all|
[w:<num>]|[f:yes|no]|[o:<num>[+]]|[n:<num>]|
[i:<num>]|[d:<char>]|[s:<num>]|[h:trim|cut|keep]
<ATTR> ::= [fg][/bg][,style]
<RE> ::= \fB<char>\fIregex\fB<char>\fR
<col/row selectors> and <RE> can be freely mixed.
The parameters of -a and -D must be delimited by blanks.
.fi
.SH DESCRIPTION
This small utility acts as a filter when no input file is given
(reads from stdin and writes to stdout) or takes its inputs from that file.
All read words are presented in a scrolling window on the terminal
\fBat\fP the current cursor position without clearing the screen before.
.PP
The selection cursor is initially positioned on the first selectable word
by default.
.PP
Options exists to explicitly or implicitly include or exclude some words by
using extended regular expressions.
Notice that when some words are explicitly excluded they can no more be
re-included after.
.PP
Excluded words are skipped when the selection cursor is moved and cannot
be searched for.
.PP
The \fB-W\fP option can be used to set the characters (or multibyte
sequences) which will be used to delimit the input words.
The default delimiters are: \fISPACE\fP, \fI\\t\fP and \fI\\n\fP.
.PP
The \fB-L\fP has a similar meaning for lines.
Special character sequences formed by a \fI\\\fP followed by one of the
characters \fIa\fP \fIb\fP \fIt\fP \fIn\fP \fIv\fP \fIf\fP \fIr\fP and
\fI\\\fP are understood and have their traditional meanings.
UTF-8 sequences introduced by \fI\\u\fP are also understood.
\fI\\u\fP can be followed by 2,4,6 or 8 hexadecimal characters.
An invalid UTF-8 sequence will be replaced by a dot (\fI.\fP), see
also below.
Example: \fI\\uc3a9\fP means latin small letter e with acute.
.PP
Note that with most shells, the \fI\\\fP before the \fIu\fP need to be
protected or escaped.
.PP
Quotations (single and double) in the input stream can be used to ignore
the word separators so that a group of words are taken as a single entity.
.PP
Non printable characters in words that are not delimiters are
converted to their traditional form (\fI\\n\fP for end-of-line,
\fI\\t\fP for tabulation...) by default.
A single dot (\fI.\fP) is also used as a placeholder otherwise.
.PP
Words containing only spaces, entered directly or resulting from a
substitution, are also rejected unless they are not selectable.
This allows special effects like creating blank lines for example.
These words are also kept in column mode, selectable or not.
.PP
\fBWarning\fP, \fBUTF-8\fP encoded codepoints are quietly converted
into dots (\fI.\fP) when the user locale is not \fBUTF-8\fP aware like
\fBPOSIX\fP or \fBC\fP by example.
.PP
.SS "Moving among words"
The cursor can be moved in every direction by using the
keyboard arrow keys (\fB\(<-\fP,\fB\(da\fP,\fB\(ua\fP,\fB\(->\fP)
or the \fIvi\fP direction keys (\fBh\fP, \fBj\fP, \fBk\fP and \fBl\fP).
\fBHOME\fP, \fBEND\fP, \fBPgDn\fP and \fBPgUp\fP can also be used,
if available, and have the following meanings:
.TS
tab(@);
l l.
\fB\(<-\fP, \fBh\fP@Previous word
\fBCTRL\ \(<-\fP, \fBH\fP@Start of line
\fB\(ua\fP, \fBk\fP@Previous line
\fBPgUp\fP, \fBK\fP@Previous page
\fBHOME\fP@First word of the window
\fBCTRL\ HOME\fP, \fBSHIFT\ HOME\fP, \fBCTRL\ K\fP@First word
\fB\(->\fP, \fBl\fP@Next word
\fBCTRL\ \(->\fP, \fBL\fP@End of line
\fB\(da\fP, \fBj\fP@Next line
\fBPgDn\fP, \fBJ\fP@Next page
\fBEND\fP@Last word of the window
\fBCTRL\ END\fP, \fBSHIFT\ END\fP, \fBCTRL\ J\fP@Last word
.TE
\fBCTRL\ \(<-\fP/\fBH\fP (resp. \fBCTRL\ \(->\fP/\fBL\fP) places the cursor
so that a maximum number of words (selectable or not) are visible to
the left (reps. right) side of the window.
If \fB-N\fP, \fB-U\fP or \fB-F\fP are used, then it becomes possible to
directly access a word by entering its number.
The numbering created using these option is done