1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
.TP
[local] prompt "\fIstring\fP"
Sets the prompt string.
If\c
.Q local
is indicated, sets the prompt string for the
.I "selected slot"
only. Otherwise, sets the global default prompt string.
Prompt strings may have the special %-sequences shown below,
with related commands given in parenthesis:
.nf
%N the \fIdefault slot\fP's file or combo name.
%n like %N, but any leading path is not shown if a filename.
%# the \fIdefault slot\fP's number.
%S the\&\&command-introduction\&\&character (cmdchar)
%0 the running program's name
%F='\fIstring\fP' \fIstring\fP shown if filtering enabled (filter)
%M='\fIstring\fP' \fIstring\fP shown if modification enabled (modify)
%w='\fIstring\fP' \fIstring\fP shown if word mode on (word)
%c='\fIstring\fP' \fIstring\fP shown if case folding on (fold)
%f='\fIstring\fP' \fIstring\fP shown if fuzzification on (fuzz).
%W='\fIstring\fP' \fIstring\fP shown if wildcard-pat. mode on (wildcard).
%d='\fIstring\fP' \fIstring\fP shown if displaying on (display).
%C='\fIstring\fP' \fIstring\fP shown if currently entering a command.
%l='\fIstring\fP' \fIstring\fP shown if logging is on (log).
%L the name of the current output log, if any (log)
.fi
For the tests (%f, etc), you can put\&\&!\&\&just after
the\&\&%\&\&to reverse
the sense of the test (i.e. %!f="no fuzz"). The reverse of %F is if
a filter is installed but disabled (i.e.
.I string
will never be shown if there is no filter for the default file).
The modify %M works comparably.
Also, you can use an alternative form for the items that take an argument
string. Replacing the quotes with parentheses will treat
.I string
as a recursive prompt specifier. For example, the specifier
.nf
%C='command'%!C(%f='fuzzy 'search:)
.fi
would result in a\c
.Q command
prompt if entering a command, while it would result in either a\c
.Q "fuzzy search:"
or a\c
.Q search:
prompt if not entering a command.
The parenthesized constructs may be nested.
Note that the letters of the test constructs are the same as the letters
for the\c
.Q !!
sequences described in INPUT SYNTAX.
An example of a nice prompt command might be:
.nf
prompt "%C(%0 command)%!C(%w'*'%!f'raw '%n)> "
.fi
With this prompt specification, the prompt would normally appear as\c
.Q "\fIfilename\fP>\ "
but when fuzzification is turned off as\c
.Q "raw \fIfilename\fP>\ " ". "
And if word-preference mode is on,
the whole thing has a\c
.Q *
prepended.
However if a command is being entered, the prompt would then become\c
.Q "\fIname\fP command" ", "
where
.I name
was the program's name (system dependent, but most likely\c
.Q lookup "). "
The default prompt format string is\c
.Q "%C(%0 command)%!C(search [%n])> " ". "
|