diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2000-07-13 11:20:46 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2000-07-13 11:20:46 +0000 |
commit | fa699be45debba815ea5e3ed5bfebde280d894a0 (patch) | |
tree | 46287228936137f2b8c4d673a5e71886f1c829e5 /Doc/Zsh | |
parent | b46926af8d6ccba49018ff0ee6eab186f5e7d5f0 (diff) | |
download | zsh-fa699be45debba815ea5e3ed5bfebde280d894a0.tar.gz zsh-fa699be45debba815ea5e3ed5bfebde280d894a0.tar.xz zsh-fa699be45debba815ea5e3ed5bfebde280d894a0.zip |
12242: based on code from Fr. Br. George (George V Kouryachy):
use negative integers in prompt to count from other end of string
Diffstat (limited to 'Doc/Zsh')
-rw-r--r-- | Doc/Zsh/prompt.yo | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Doc/Zsh/prompt.yo b/Doc/Zsh/prompt.yo index 7ba519d3e..e486b29c4 100644 --- a/Doc/Zsh/prompt.yo +++ b/Doc/Zsh/prompt.yo @@ -44,7 +44,8 @@ xitem(tt(%d)) item(tt(%/))( Present working directory (tt($PWD)). If an integer follows the `tt(%)', it specifies a number of trailing components of tt($PWD) to show; zero -means the whole path. +means the whole path. A negative integer specifies leading components, +i.e. tt(%-1d) specifies the first component. ) item(tt(%~))( As tt(%d) and tt(%/), but if tt($PWD) has a named directory as its prefix, @@ -64,7 +65,8 @@ The full machine hostname. item(tt(%m))( The hostname up to the first `tt(.)'. An integer may follow the `tt(%)' to specify -how many components of the hostname are desired. +how many components of the hostname are desired. With a negative integer, +trailing components of the hostname are shown. ) item(tt(%S) LPAR()tt(%s)RPAR())( Start (stop) standout mode. @@ -93,7 +95,7 @@ The name of the script, sourced file, or shell function that zsh is currently executing, whichever was started most recently. If there is none, this is equivalent to the parameter tt($0). An integer may follow the `tt(%)' to specify a number of trailing path components to show; zero -means the full path. +means the full path. A negative integer specifies leading components. ) item(tt(%i))( The line number currently being executed in the script, sourced file, or @@ -126,7 +128,7 @@ The return code of the last command executed just before the prompt. item(tt(%_))( The status of the parser, i.e. the shell constructs (like `tt(if)' and `tt(for)') that have been started on the command line. If given an integer -number that many strings will be printed; zero or no integer means +number that many strings will be printed; zero or negative or no integer means print as many as there are. This is most useful in prompts tt(PS2) for continuation lines and tt(PS4) for debugging with the tt(XTRACE) option; in the latter case it will also work non-interactively. @@ -145,7 +147,8 @@ capability vectors. item(tt(%v))( vindex(psvar, use of) The value of the first element of the tt(psvar) array parameter. Following -the `tt(%)' with an integer gives that element of the array. +the `tt(%)' with an integer gives that element of the array. Negative +integers count from the end of the array. ) item(tt(%{)...tt(%}))( Include a string as a literal escape sequence. @@ -163,10 +166,9 @@ var(true-text) and var(false-text) may both contain arbitrarily-nested escape sequences, including further ternary expressions. -The left -parenthesis may be preceded or followed by a positive integer var(n), -which defaults to zero. The test character var(x) may be any of the -following: +The left parenthesis may be preceded or followed by a positive integer var(n), +which defaults to zero. A negative integer will be multiplied by -1. +The test character var(x) may be any of the following: startsitem() sxitem(tt(c)) |