Sophie

Sophie

distrib > Mandriva > 9.1 > i586 > by-pkgid > 0195c26144d6a6d8437da6bf9d0aeff3 > files > 66

zsh-doc-4.1.0-0.dev5.4mdk.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      "http://www.w3.org/TR/html40/loose.dtd">
<HTML>
<!-- Created on August, 9 2002 by texi2html 1.65 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>

-->
<HEAD>
<TITLE>zsh: User Contributions</TITLE>

<META NAME="description" CONTENT="zsh: User Contributions">
<META NAME="keywords" CONTENT="zsh: User Contributions">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.65">

</HEAD>

<BODY LANG="en" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">

<A NAME="SEC179"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_22.html#SEC178"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC180"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_22.html#SEC161"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC180"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1> 23. User Contributions </H1>
<!--docid::SEC179::-->
<A NAME="IDX1507"></A>
<P>

<HR SIZE="6">
<A NAME="SEC180"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC181"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC181"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 23.1 Description </H2>
<!--docid::SEC180::-->
<P>

The Zsh source distribution includes a number of items contributed by the
user community.  These are not inherently a part of the shell, and some
may not be available in every zsh installation.  The most significant of
these are documented here.  For documentation on other contributed items
such as shell functions, look for comments in the function source files.
</P>
<P>

<TABLE BORDER="0" CELLSPACING="0">
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="zsh_23.html#SEC181">23.2 Utilities</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="zsh_23.html#SEC186">23.3 Prompt Themes</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="zsh_23.html#SEC189">23.4 ZLE Functions</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="zsh_23.html#SEC192">23.5 Other Functions</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
</TABLE>
<P>

<A NAME="Utilities"></A>
</P>
<P>

<HR SIZE="6">
<A NAME="SEC181"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC180"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC182"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC186"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 23.2 Utilities </H2>
<!--docid::SEC181::-->
<P>

</P>
<P>

<HR SIZE="6">
<A NAME="SEC182"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC181"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC183"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC183"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 23.2.1 Accessing On-Line Help </H3>
<!--docid::SEC182::-->
<A NAME="IDX1508"></A>
<P>

The key sequence <TT>ESC h</TT> is normally bound by ZLE to execute the
<TT>run-help</TT> widget (see
<A HREF="zsh_17.html#SEC83">17. Zsh Line Editor</A>).  This invokes the <TT>run-help</TT> command with the command word from the
current input line as its argument.  By default, <TT>run-help</TT> is an alias
for the <TT>man</TT> command, so this often fails when the command word is a
shell builtin or a user-defined function.  By redefining the <TT>run-help</TT>
alias, one can improve the on-line help provided by the shell.
</P>
<P>

The <TT>helpfiles</TT> utility, found in the <TT>Util</TT> directory of the
distribution, is a Perl program that can be used to process the zsh manual
to produce a separate help file for each shell builtin and for many other
shell features as well.  The autoloadable <TT>run-help</TT> function, found in
<TT>Functions/Misc</TT>, searches for these helpfiles and performs several
other tests to produce the most complete help possible for the command.
</P>
<P>

There may already be a directory of help files on your system; look in
<TT>/usr/share/zsh</TT> or <TT>/usr/local/share/zsh</TT> and subdirectories below
those, or ask your system administrator.
</P>
<P>

To create your own help files with <TT>helpfiles</TT>, choose or create a
directory where the individual command help files will reside.  For
example, you might choose <TT>~/zsh_help</TT>.  If you unpacked the zsh
distribution in your home directory, you would use the commands:
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>mkdir ~/zsh_help
cd ~/zsh_help
man zshall | colcrt - | \ 
perl ~/zsh-4.0.5/Util/helpfiles
</pre></td></tr></table><P>

<A NAME="IDX1509"></A>
Next, to use the <TT>run-help</TT> function, you need to add lines something
like the following to your <TT>.zshrc</TT> or equivalent startup file:
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>unalias run-help
autoload run-help
HELPDIR=~/zsh_help
</pre></td></tr></table><P>

<A NAME="IDX1510"></A>
The <TT>HELPDIR</TT> parameter tells <TT>run-help</TT> where to look for the help
files.  If your system already has a help file directory installed, set
<TT>HELPDIR</TT> to the path of that directory instead.
</P>
<P>

Note that in order for `<TT>autoload run-help</TT>' to work, the <TT>run-help</TT>
file must be in one of the directories named in your <TT>fpath</TT> array (see
<A HREF="zsh_14.html#SEC73">14.6 Parameters Used By The Shell</A>).  This should already be the case if you have a standard zsh
installation; if it is not, copy <TT>Functions/Misc/run-help</TT> to an
appropriate directory.
</P>
<P>

</P>
<P>

<HR SIZE="6">
<A NAME="SEC183"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC182"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC184"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC184"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 23.2.2 Recompiling Functions </H3>
<!--docid::SEC183::-->
<A NAME="IDX1511"></A>
<A NAME="IDX1512"></A>
<P>

If you frequently edit your zsh functions, or periodically update your zsh
installation to track the latest developments, you may find that function
digests compiled with the <TT>zcompile</TT> builtin are frequently out of date
with respect to the function source files.  This is not usually a problem,
because zsh always looks for the newest file when loading a function, but
it may cause slower shell startup and function loading.  Also, if a digest
file is explicitly used as an element of <TT>fpath</TT>, zsh won't check whether
any of its source files has changed.
</P>
<P>

The <TT>zrecompile</TT> autoloadable function, found in <TT>Functions/Misc</TT>, can
be used to keep function digests up to date.
</P>
<P>

</P>
<DL COMPACT>
<A NAME="IDX1513"></A>
<DT><TT>zrecompile</TT> [ <TT>-qt</TT> ] [ <VAR>name</VAR> ... ]
<DD><DT><TT>zrecompile</TT> [ <TT>-qt</TT> ] <TT>-p</TT> <VAR>args</VAR> [ <TT>-</TT><TT>-</TT> <VAR>args</VAR> ... ]
<DD>This tries to find <TT>*.zwc</TT> files and automatically re-compile them if at
least one of the original files is newer than the compiled file.  This
works only if the names stored in the compiled files are full paths or are
relative to the directory that contains the <TT>.zwc</TT> file.
<P>

In the first form, each <VAR>name</VAR> is the name of a compiled file or a
directory containing <TT>*.zwc</TT> files that should be checked.  If no
arguments are given, the directories and <TT>*.zwc</TT> files in <TT>fpath</TT> are
used.
</P>
<P>

When <TT>-t</TT> is given, no compilation is performed, but a return status of
zero (true) is set if there are files that need to be re-compiled and
non-zero (false) otherwise.  The <TT>-q</TT> option quiets the chatty output
that describes what <TT>zrecompile</TT> is doing.
</P>
<P>

Without the <TT>-t</TT> option, the return status is zero if all files that
needed re-compilation could be compiled and non-zero if compilation for at
least one of the files failed.
</P>
<P>

If the <TT>-p</TT> option is given, the <VAR>args</VAR> are interpreted as one
or more sets of arguments for <TT>zcompile</TT>, separated by `<TT>-</TT><TT>-</TT>'.
For example:
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>zrecompile -p \ 
           -R ~/.zshrc -- \ 
           -M ~/.zcompdump -- \ 
           ~/zsh/comp.zwc ~/zsh/Completion/*/_*
</pre></td></tr></table><P>

This compiles <TT>~/.zshrc</TT> into <TT>~/.zshrc.zwc</TT> if that doesn't exist or
if it is older than <TT>~/.zshrc</TT>. The compiled file will be marked for
reading instead of mapping. The same is done for <TT>~/.zcompdump</TT> and
<TT>~/.zcompdump.zwc</TT>, but this compiled file is marked for mapping. The
last line re-creates the file <TT>~/zsh/comp.zwc</TT> if any of the files
matching the given pattern is newer than it.
</P>
<P>

Without the <TT>-p</TT> option, <TT>zrecompile</TT> does not create function digests
that do not already exist, nor does it add new functions to the digest.
</P>
<P>

</DL>
<P>

The following shell loop is an example of a method for creating function
digests for all functions in your <TT>fpath</TT>, assuming that you have write
permission to the directories:
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>for ((i=1; i &lt;= $#fpath; ++i)); do
  dir=$fpath[i]
  zwc=${dir:t}.zwc
  if [[ $dir == (.|..) || $dir == (.|..)/* ]]; then
    continue
  fi
  files=($dir/*(N-.))
  if [[ -w $dir:h &amp;&amp; -n $files ]]; then
    files=(${${(M)files%/*/*}#/})
    if ( cd $dir:h &amp;&amp;
         zrecompile -p -U -z $zwc $files ); then
      fpath[i]=$fpath[i].zwc
    fi
  fi
done
</pre></td></tr></table><P>

The <TT>-U</TT> and <TT>-z</TT> options are appropriate for functions in the default
zsh installation <TT>fpath</TT>; you may need to use different options for your
personal function directories.
</P>
<P>

Once the digests have been created and your <TT>fpath</TT> modified to refer to
them, you can keep them up to date by running <TT>zrecompile</TT> with no
arguments.
</P>
<P>

</P>
<P>

<HR SIZE="6">
<A NAME="SEC184"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC183"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC185"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC185"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 23.2.3 Keyboard Definition </H3>
<!--docid::SEC184::-->
<A NAME="IDX1514"></A>
<P>

<A NAME="IDX1515"></A>
The large number of possible combinations of keyboards, workstations,
terminals, emulators, and window systems makes it impossible for zsh to
have built-in key bindings for every situation.  The <TT>zkbd</TT> utility,
found in Functions/Misc, can help you quickly create key bindings for your
configuration.
</P>
<P>

Run <TT>zkbd</TT> either as an autoloaded function, or as a shell script:
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>zsh -f ~/zsh-4.0.5/Functions/Misc/zkbd
</pre></td></tr></table><P>

When you run <TT>zkbd</TT>, it first asks you to enter your terminal type; if
the default it offers is correct, just press return.  It then asks you to
press a number of different keys to determine characteristics of your
keyboard and terminal; <TT>zkbd</TT> warns you if it finds anything out of the
ordinary, such as a Delete key that sends neither <TT>^H</TT> nor <TT>^?</TT>.
</P>
<P>

The keystrokes read by <TT>zkbd</TT> are recorded as a definition for an
associative array named <TT>key</TT>, written to a file in the subdirectory
<TT>.zkbd</TT> within either your <TT>HOME</TT> or <TT>ZDOTDIR</TT> directory.  The name
of the file is composed from the <TT>TERM</TT>, <TT>VENDOR</TT> and <TT>OSTYPE</TT>
parameters, joined by hyphens.
</P>
<P>

You may read this file into your <TT>.zshrc</TT> or another startup file with
the &quot;source&quot; or &quot;.&quot; commands, then reference the <TT>key</TT> parameter in
bindkey commands, like this:
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>source ${ZDOTDIR:-$HOME}/.zkbd/$TERM-$VENDOR-$OSTYPE
[[ -n ${key[Left]} ]] &amp;&amp; bindkey &quot;${key[Left]}&quot; backward-char
[[ -n ${key[Right]} ]] &amp;&amp; bindkey &quot;${key[Right]}&quot; forward-char
# etc.
</pre></td></tr></table><P>

Note that in order for `<TT>autoload zkbd</TT>' to work, the <TT>zkdb</TT> file must
be in one of the directories named in your <TT>fpath</TT> array (see
<A HREF="zsh_14.html#SEC73">14.6 Parameters Used By The Shell</A>).  This should already be the case if you have a standard zsh
installation; if it is not, copy <TT>Functions/Misc/zkbd</TT> to an
appropriate directory.
</P>
<P>

</P>
<P>

<HR SIZE="6">
<A NAME="SEC185"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC184"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC186"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC186"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 23.2.4 Dumping Shell State </H3>
<!--docid::SEC185::-->
<A NAME="IDX1516"></A>
<P>

Occasionally you may encounter what appears to be a bug in the shell,
particularly if you are using a beta version of zsh or a development
release.  Usually it is sufficient to send a description of the
problem to one of the zsh mailing lists (see
<A HREF="zsh_2.html#SEC6">2.3 Mailing Lists</A>), but sometimes one of the zsh developers will need to recreate your
environment in order to track the problem down.
</P>
<P>

The script named <TT>reporter</TT>, found in the <TT>Util</TT> directory of the
distribution, is provided for this purpose.  (It is also possible to
<TT>autoload reporter</TT>, but <TT>reporter</TT> is not installed in <TT>fpath</TT>
by default.)  This script outputs a detailed dump of the shell state,
in the form of another script that can be read with `<TT>zsh -f</TT>' to
recreate that state.
</P>
<P>

To use <TT>reporter</TT>, read the script into your shell with the `<TT>.</TT>'
command and redirect the output into a file:
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>. ~/zsh-4.0.5/Util/reporter &gt; zsh.report
</pre></td></tr></table><P>

You should check the <TT>zsh.report</TT> file for any sensitive information
such as passwords and delete them by hand before sending the script to the
developers.  Also, as the output can be voluminous, it's best to wait for
the developers to ask for this information before sending it.
</P>
<P>

You can also use <TT>reporter</TT> to dump only a subset of the shell state.
This is sometimes useful for creating startup files for the first time.
Most of the output from reporter is far more detailed than usually is
necessary for a startup file, but the <TT>aliases</TT>, <TT>options</TT>, and
<TT>zstyles</TT> states may be useful because they include only changes from
the defaults.  The <TT>bindings</TT> state may be useful if you have created
any of your own keymaps, because <TT>reporter</TT> arranges to dump the keymap
creation commands as well as the bindings for every keymap.
</P>
<P>

As is usual with automated tools, if you create a startup file with
<TT>reporter</TT>, you should edit the results to remove unnecessary commands.
Note that if you're using the new completion system, you should <EM>not</EM>
dump the <TT>functions</TT> state to your startup files with <TT>reporter</TT>; use
the <TT>compdump</TT> function instead (see
<A HREF="zsh_19.html#SEC104">19. Completion System</A>).
</P>
<P>

</P>
<DL COMPACT>
<DT><TT>reporter</TT> [ <VAR>state</VAR> ... ]
<DD><A NAME="IDX1517"></A>
Print to standard output the indicated subset of the current shell state.
The <VAR>state</VAR> arguments may be one or more of:
<P>

</P>
<DL COMPACT>
<DT><TT>all</TT>
<DD>Output everything listed below.
<DT><TT>aliases</TT>
<DD>Output alias definitions.
<DT><TT>bindings</TT>
<DD>Output ZLE key maps and bindings.
<DT><TT>completion</TT>
<DD>Output old-style <TT>compctl</TT> commands.
New completion is covered by <TT>functions</TT> and <TT>zstyles</TT>.
<DT><TT>functions</TT>
<DD>Output autoloads and function definitions.
<DT><TT>limits</TT>
<DD>Output <TT>limit</TT> commands.
<DT><TT>options</TT>
<DD>Output <TT>setopt</TT> commands.
<DT><TT>styles</TT>
<DD>Same as <TT>zstyles</TT>.
<DT><TT>variables</TT>
<DD>Output shell parameter assignments, plus <TT>export</TT>
commands for any environment variables.
<DT><TT>zstyles</TT>
<DD>Output <TT>zstyle</TT> commands.
</DL>
<P>

If the <VAR>state</VAR> is omitted, <TT>all</TT> is assumed.
</P>
<P>

With the exception of `<TT>all</TT>', every <VAR>state</VAR> can be abbreviated by
any prefix, even a single letter; thus <TT>a</TT> is the same as <TT>aliases</TT>,
<TT>z</TT> is the same as <TT>zstyles</TT>, etc.
</DL>
<P>

<A NAME="Prompt Themes"></A>
</P>
<P>

<HR SIZE="6">
<A NAME="SEC186"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC185"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC187"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC189"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 23.3 Prompt Themes </H2>
<!--docid::SEC186::-->
<P>

</P>
<P>

<HR SIZE="6">
<A NAME="SEC187"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC186"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC188"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC188"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 23.3.1 Installation </H3>
<!--docid::SEC187::-->
<P>

You should make sure all the functions from the <TT>Functions/Prompts</TT>
directory of the source distribution are available; they all begin with
the string `<TT>prompt_</TT>' except for the special function`<TT>promptinit</TT>'.
You also need the `<TT>colors</TT>' function from <TT>Functions/Misc</TT>.  All of
these functions may already have been installed on your system; if not,
you will need to find them and copy them.  The directory should appear as
one of the elements of the <TT>fpath</TT> array (this should already be the
case if they were installed), and at least the function <TT>promptinit</TT>
should be autoloaded; it will autoload the rest.  Finally, to initialize
the use of the system you need to call the <TT>promptinit</TT> function.  The
following code in your <TT>.zshrc</TT> will arrange for this; assume the
functions are stored in the directory <TT>~/myfns</TT>:
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>fpath=(~/myfns $fpath)
autoload -U promptinit
promptinit
</pre></td></tr></table><P>

</P>
<P>

<HR SIZE="6">
<A NAME="SEC188"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC187"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC189"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC189"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 23.3.2 Theme Selection </H3>
<!--docid::SEC188::-->
<P>

Use the <TT>prompt</TT> command to select your preferred theme.  This command
may be added to your <TT>.zshrc</TT> following the call to <TT>promptinit</TT> in
order to start zsh with a theme already selected.
</P>
<P>

</P>
<DL COMPACT>
<DT><TT>prompt</TT> [ <TT>-c</TT> | <TT>-l</TT> ]
<DD><DT><TT>prompt</TT> [ <TT>-p</TT> | <TT>-h</TT> ] [ <VAR>theme</VAR> ... ]
<DD><DT><TT>prompt</TT> [ <TT>-s</TT> ] <VAR>theme</VAR> [ <VAR>arg</VAR> ... ]
<DD>Set or examine the prompt theme.  With no options and a <VAR>theme</VAR>
argument, the theme with that name is set as the current theme.  The
available themes are determined at run time; use the <TT>-l</TT> option to see
a list.  The special <VAR>theme</VAR> `<TT>random</TT>' selects at random one of the
available themes and sets your prompt to that.
<P>

In some cases the <VAR>theme</VAR> may be modified by one or more arguments,
which should be given after the theme name.  See the help for each theme
for descriptions of these arguments.
</P>
<P>

Options are:
</P>
<P>

</P>
<DL COMPACT>
<DT><TT>-c</TT>
<DD>Show the currently selected theme and its parameters, if any.
<DT><TT>-l</TT>
<DD>List all available prompt themes.
<DT><TT>-p</TT>
<DD>Preview the theme named by <VAR>theme</VAR>, or all themes if no
<VAR>theme</VAR> is given.
<DT><TT>-h</TT>
<DD>Show help for the theme named by <VAR>theme</VAR>, or for the
<TT>prompt</TT> function if no <VAR>theme</VAR> is given.
<DT><TT>-s</TT>
<DD>Set <VAR>theme</VAR> as the current theme and save state.
</DL>
<P>

</P>
<DT><TT>prompt_</TT><VAR>theme</VAR><TT>_setup</TT>
<DD>Each available <VAR>theme</VAR> has a setup function which is called by the
<TT>prompt</TT> function to install that theme.  This function may define
other functions as necessary to maintain the prompt, including functions
used to preview the prompt or provide help for its use.  You should not
normally call a theme's setup function directly.
<P>

</DL>
<P>

<A NAME="ZLE Functions"></A>
</P>
<P>

<HR SIZE="6">
<A NAME="SEC189"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC188"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC190"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC192"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 23.4 ZLE Functions </H2>
<!--docid::SEC189::-->
<P>

</P>
<P>

<HR SIZE="6">
<A NAME="SEC190"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC189"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC191"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC191"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 23.4.1 Widgets </H3>
<!--docid::SEC190::-->
<P>

These functions all implement user-defined ZLE widgets (see
<A HREF="zsh_17.html#SEC83">17. Zsh Line Editor</A>) which can be bound to keystrokes in interactive shells.  To use them,
your <TT>.zshrc</TT> should contain lines of the form
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>autoload <VAR>function</VAR>
zle -N <VAR>function</VAR>
</pre></td></tr></table><P>

followed by an appropriate <TT>bindkey</TT> command to associate the function
with a key sequence.  Suggested bindings are described below.
</P>
<P>

</P>
<DL COMPACT>
<A NAME="IDX1518"></A>
<A NAME="IDX1519"></A>
<A NAME="IDX1520"></A>
<A NAME="IDX1521"></A>
<A NAME="IDX1522"></A>
<A NAME="IDX1523"></A>
<A NAME="IDX1524"></A>
<DT><TT>bash-forward-word</TT>, <TT>bash-backward-word</TT>
<DD><DT><TT>bash-kill-word</TT>, <TT>bash-backward-kill-word</TT>
<DD><DT><TT>bash-up-case-word</TT>, <TT>bash-down-case-word</TT>
<DD><DT><TT>bash-transpose-words</TT>
<DD>These work similarly to the corresponding builtin zle functions without the
`<TT>bash-</TT>' prefix, but a word is considered to consist of alphanumeric
characters only.  If you wish to replace your existing bindings with these
four widgets, the following is sufficient:
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>for widget in kill-word backward-kill-word \ 
forward-word backward-word \ 
up-case-word down-case-word \ 
transpose-words; do 
  autoload bash-$widget 
  zle -N $widget bash-$widget
done
</pre></td></tr></table><P>

<A NAME="IDX1525"></A>
</P>
<DT><TT>cycle-completion-positions</TT>
<DD>After inserting an unambiguous string into the command line, the new
function based completion system may know about multiple places in
this string where characters are missing or differ from at least one
of the possible matches.  It will then place the cursor on the
position it considers to be the most interesting one, i.e. the one
where one can disambiguate between as many matches as possible with as 
little typing as possible.
<P>

This widget allows the cursor to be easily moved to the other interesting
spots.  It can be invoked repeatedly to cycle between all positions
reported by the completion system.
</P>
<P>

<A NAME="IDX1526"></A>
</P>
<DT><TT>edit-command-line</TT>
<DD>Edit the command line using your visual editor, as in <TT>ksh</TT>.
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>bindkey -M vicmd v edit-command-line
</pre></td></tr></table><P>

<A NAME="IDX1527"></A>
<A NAME="IDX1528"></A>
</P>
<DT><TT>history-search-end</TT>
<DD>This function implements the widgets
<TT>history-beginning-search-backward-end</TT> and
<TT>history-beginning-search-forward-end</TT>.  These commands work by first
calling the corresponding builtin widget (see
<A HREF="zsh_17.html#SEC92">17.6.2 History Control</A>) and then moving the cursor to the end of the line.  The original cursor
position is remembered and restored before calling the builtin widget a
second time, so that the same search is repeated to look farther through
the history.
<P>

Although you <TT>autoload</TT> only one function, the commands to use it are
slightly different because it implements two widgets.
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>zle -N history-beginning-search-backward-end \ 
       history-search-end
zle -N history-beginning-search-forward-end \ 
       history-search-end
bindkey '\e^P' history-beginning-search-backward-end
bindkey '\e^N' history-beginning-search-forward-end
</pre></td></tr></table><P>

<A NAME="IDX1529"></A>
<A NAME="IDX1530"></A>
</P>
<DT><TT>incarg</TT>
<DD>Typing the keystrokes for this widget with the cursor placed on or to the
left of an integer causes that integer to be incremented by one.  With a
numeric prefix argument, the number is incremented by the amount of the
argument (decremented if the prefix argument is negative).  The shell
parameter <TT>incarg</TT> may be set to change the default increment something
other than one.
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>bindkey '^X+' incarg
</pre></td></tr></table><P>

<A NAME="IDX1531"></A>
</P>
<DT><TT>incremental-complete-word</TT>
<DD>This allows incremental completion of a word.  After starting this
command, a list of completion choices can be shown after every character
you type, which you can delete with <TT>^H</TT> or <TT>DEL</TT>.  Pressing return
accepts the completion so far and returns you to normal editing (that is,
the command line is <EM>not</EM> immediately executed).  You can hit <TT>TAB</TT> to
do normal completion, <TT>^G</TT> to abort back to the state when you started,
and <TT>^D</TT> to list the matches.
<P>

This works only with the new function based completion system.
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>bindkey '^Xi' incremental-complete-word
</pre></td></tr></table><P>

<A NAME="IDX1532"></A>
</P>
<DT><TT>insert-files</TT>
<DD>This function allows you type a file pattern, and see the results of the
expansion at each step.  When you hit return, all expansions are inserted
into the command line.
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>bindkey '^Xf' insert-files
</pre></td></tr></table><P>

<A NAME="IDX1533"></A>
<A NAME="IDX1534"></A>
</P>
<DT><TT>predict-on</TT>
<DD>This set of functions implements predictive typing using history search.
After <TT>predict-on</TT>, typing characters causes the editor to look backward
in the history for the first line beginning with what you have typed so
far.  After <TT>predict-off</TT>, editing returns to normal for the line found.
In fact, you often don't even need to use <TT>predict-off</TT>, because if the
line doesn't match something in the history, adding a key performs
standard completion, and then inserts itself if no completions were found.
However, editing in the middle of a line is liable to confuse prediction;
see the <TT>toggle</TT> style below.
<P>

With the function based completion system (which is needed for this), you
should be able to type <TT>TAB</TT> at almost any point to advance the cursor
to the next &quot;interesting&quot; character position (usually the end of the
current word, but sometimes somewhere in the middle of the word).  And of
course as soon as the entire line is what you want, you can accept with
return, without needing to move the cursor to the end first.
</P>
<P>

The first time <TT>predict-on</TT> is used, it creates several additional
widget functions:
</P>
<P>

</P>
<DL COMPACT>
<DT><TT>delete-backward-and-predict</TT>
<DD>Replaces the <TT>backward-delete-char</TT>
widget.  You do not need to bind this yourself.
<DT><TT>insert-and-predict</TT>
<DD>Implements predictive typing by replacing the
<TT>self-insert</TT> widget.  You do not need to bind this yourself.
<DT><TT>predict-off</TT>
<DD>Turns off predictive typing.
</DL>
<P>

Although you <TT>autoload</TT> only the <TT>predict-on</TT> function, it is
necessary to create a keybinding for <TT>predict-off</TT> as well.
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>zle -N predict-on
zle -N predict-off
bindkey '^X^Z' predict-on
bindkey '^Z' predict-off
</pre></td></tr></table><P>

<A NAME="IDX1535"></A>
</P>
<DT><TT>smart-insert-last-word</TT>
<DD>This function may replace the <TT>insert-last-word</TT> widget, like so:
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>zle -N insert-last-word smart-insert-last-word
</pre></td></tr></table><P>

With a numeric prefix, it behaves like <TT>insert-last-word</TT>, except that
words in comments are ignored when <TT>INTERACTIVE_COMMENTS</TT> is set.
</P>
<P>

Otherwise, the rightmost &quot;interesting&quot; word from the previous command is
found and inserted.  The default definition of &quot;interesting&quot; is that the
word contains at least one alphabetic character, slash, or backslash.
This definition may be overridden by use of the <TT>match</TT> style.  The
context used to look up the style is the widget name, so usually the
context is <TT>:insert-last-word</TT>.  However, you can bind this function to
different widgets to use different patterns:
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>zle -N insert-last-assignment smart-insert-last-word
zstyle :insert-last-assignment match '[[:alpha:]][][[:alnum:]]#=*'
bindkey '\e=' insert-last-assignment
</pre></td></tr></table><P>

</DL>
<P>

</P>
<P>

<HR SIZE="6">
<A NAME="SEC191"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC190"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC192"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC192"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 23.4.2 Styles </H3>
<!--docid::SEC191::-->
<P>

The behavior of several of the above widgets can be controlled by the use
of the <TT>zstyle</TT> mechanism.  In particular, widgets that interact with
the completion system pass along their context to any completions that
they invoke.
</P>
<P>

</P>
<DL COMPACT>
<A NAME="IDX1536"></A>
<DT><TT>break-keys</TT>
<DD>This style is used by the <TT>incremental-complete-word</TT> widget. Its value
should be a pattern, and all keys matching this pattern will cause the
widget to stop incremental completion without the key having any further
effect. Like all styles used directly by
<TT>incremental-complete-word</TT>, this style is looked up using the
context `<TT>:incremental</TT>'.
<P>

<A NAME="IDX1537"></A>
</P>
<DT><TT>completer</TT>
<DD>The <TT>incremental-complete-word</TT> and <TT>insert-and-predict</TT> widgets set
up their top-level context name before calling completion.  This allows
one to define different sets of completer functions for normal completion
and for these widgets.  For example, to use completion, approximation and
correction for normal completion, completion and correction for
incremental completion and only completion for prediction one could use:
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>zstyle ':completion:*' completer \ 
        _complete _correct _approximate
zstyle ':completion:incremental:*' completer \ 
        _complete _correct
zstyle ':completion:predict:*' completer \ 
        _complete
</pre></td></tr></table><P>

It is a good idea to restrict the completers used in prediction, because
they may be automatically invoked as you type.  The <TT>_list</TT> and
<TT>_menu</TT> completers should never be used with prediction.  The
<TT>_approximate</TT>, <TT>_correct</TT>, <TT>_expand</TT>, and <TT>_match</TT> completers may
be used, but be aware that they may change characters anywhere in the word
behind the cursor, so you need to watch carefully that the result is what
you intended.
</P>
<P>

<A NAME="IDX1538"></A>
</P>
<DT><TT>cursor</TT>
<DD>The <TT>insert-and-predict</TT> widget uses this style, in the context
`<TT>:predict</TT>', to decide where to place the cursor after completion has
been tried.  Values are:
<P>

</P>
<DL COMPACT>
<DT><TT>complete</TT>
<DD>The cursor is left where it was when completion finished, but only if
it is after a character equal to the one just inserted by the user.  If 
it is after another character, this value is the same as `<TT>key</TT>'.
<P>

</P>
<DT><TT>key</TT>
<DD>The cursor is left
after the <VAR>n</VAR>th occurrence of the character just inserted, where
<VAR>n</VAR> is the number of times that character appeared in the word
before completion was attempted.  In short, this has the effect of
leaving the cursor after the character just typed even if the
completion code found out that no other characters need to be inserted 
at that position.
<P>

</DL>
<P>

Any other value for this style unconditionally leaves the cursor at the
position where the completion code left it.
</P>
<P>

<A NAME="IDX1539"></A>
</P>
<DT><TT>list</TT>
<DD>When using the <TT>incremental-complete-word</TT> widget, this style says
if the matches should be listed on every key press (if they fit on the 
screen).  Use the context prefix `<TT>:completion:incremental</TT>'.
<P>

The <TT>insert-and-predict</TT> widget uses this style to decide if the
completion should be shown even if there is only one possible completion.
This is done if the value of this style is the string <TT>always</TT>.  In this
case the context is `<TT>:predict</TT>' (<EM>not</EM> `<TT>:completion:predict</TT>').
</P>
<P>

<A NAME="IDX1540"></A>
</P>
<DT><TT>match</TT>
<DD>This style is used by <TT>smart-insert-last-word</TT> to provide a pattern
(using full <TT>EXTENDED_GLOB</TT> syntax) that matches an interesting word.
The context is the name of the widget to which <TT>smart-insert-last-word</TT>
is bound (see above).  The default behavior of <TT>smart-insert-last-word</TT>
is equivalent to:
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>zstyle :insert-last-word match '*[[:alpha:]/\\]*'
</pre></td></tr></table><P>

However, you might want to include words that contain spaces:
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>zstyle :insert-last-word match '*[[:alpha:][:space:]/\\]*'
</pre></td></tr></table><P>

Or include numbers as long as the word is at least two characters long:
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>zstyle :insert-last-word match '*([[:digit:]]?|[[:alpha:]/\\])*'
</pre></td></tr></table><P>

The above example causes redirections like &quot;2&gt;&quot; to be included.
</P>
<P>

<A NAME="IDX1541"></A>
</P>
<DT><TT>prompt</TT>
<DD>The <TT>incremental-complete-word</TT> widget shows the value of this
style in the status line during incremental completion.  The string
value may contain any of the following substrings in the manner of
the <TT>PS1</TT> and other prompt parameters:
<P>

</P>
<DL COMPACT>
<DT><TT>%c</TT>
<DD>Replaced by the name of the completer function that generated the
matches (without the leading underscore).
<P>

</P>
<DT><TT>%l</TT>
<DD>When the <TT>list</TT> style is set,
replaced by `<TT>...</TT>' if the list of matches is too long to fit on the
screen and with an empty string otherwise.  If the <TT>list</TT> style is
`false' or not set, `<TT>%l</TT>' is always removed.
<P>

</P>
<DT><TT>%n</TT>
<DD>Replaced by the number of matches generated.
<P>

</P>
<DT><TT>%s</TT>
<DD>Replaced by `<TT>-no match-</TT>', `<TT>-no prefix-</TT>', or an empty string
if there is no completion matching the word on the line, if the
matches have no common prefix different from the word on the line, or
if there is such a common prefix, respectively.
<P>

</P>
<DT><TT>%u</TT>
<DD>Replaced by the unambiguous part of all matches, if there
is any, and if it is different from the word on the line.
<P>

</DL>
<P>

Like `<TT>break-keys</TT>', this uses the `<TT>:incremental</TT>' context.
</P>
<P>

<A NAME="IDX1542"></A>
</P>
<DT><TT>stop-keys</TT>
<DD>This style is used by the <TT>incremental-complete-word</TT> widget.  Its value
is treated similarly to the one for the <TT>break-keys</TT> style (and uses 
the same context: `<TT>:incremental</TT>').  However, in
this case all keys matching the pattern given as its value will stop
incremental completion and will then execute their usual function.
<P>

<A NAME="IDX1543"></A>
</P>
<DT><TT>toggle</TT>
<DD>This boolean style is used by <TT>predict-on</TT> and its related widgets in
the context `<TT>:predict</TT>'.  If set to one of the standard `true' values,
predictive typing is automatically toggled off in situations where it is
unlikely to be useful, such as when editing a multi-line buffer or after
moving into the middle of a line and then deleting a character.  The
default is to leave prediction turned on until an explicit call to
<TT>predict-off</TT>.
<P>

<A NAME="IDX1544"></A>
</P>
<DT><TT>verbose</TT>
<DD>This boolean style is used by <TT>predict-on</TT> and its related widgets in
the context `<TT>:predict</TT>'.  If set to one of the standard `true' values,
these widgets display a message below the prompt when the predictive state
is toggled.  This is most useful in combination with the <TT>toggle</TT> style.
The default does not display these messages.
<P>

</DL>
<P>

<A NAME="Other Functions"></A>
</P>
<P>

<HR SIZE="6">
<A NAME="SEC192"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC191"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC193"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC193"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 23.5 Other Functions </H2>
<!--docid::SEC192::-->
<P>

There are a large number of helpful functions in the <TT>Functions/Misc</TT>
directory of the zsh distribution.  Most are very simple and do not
require documentation here, but a few are worthy of special mention.
</P>
<P>

</P>
<P>

<HR SIZE="6">
<A NAME="SEC193"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC192"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC194"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC194"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 23.5.1 Descriptions </H3>
<!--docid::SEC193::-->
<P>

</P>
<DL COMPACT>
<A NAME="IDX1545"></A>
<DT><TT>colors</TT>
<DD>This function initializes several associative arrays to map color names to
(and from) the ANSI standard eight-color terminal codes.  These are used
by the prompt theme system (<A HREF="zsh_23.html#SEC186">23.3 Prompt Themes</A>).  You seldom should need to run
<TT>colors</TT> more than once.
<P>

The eight base colors are: black, red, green, yellow, blue, magenta, cyan,
and white.  Each of these has codes for foreground and background.  In
addition there are eight intensity attributes: bold, faint, standout,
underline, blink, reverse, and conceal.  Finally, there are six codes used
to negate attributes: none (reset all attributes to the defaults), normal
(neither bold nor faint), no-standout, no-underline, no-blink, and
no-reverse.
</P>
<P>

Some terminals do not support all combinations of colors and intensities.
</P>
<P>

The associative arrays are:
</P>
<P>

</P>
<DL COMPACT>
<DT>color
<DD><DT>colour
<DD>Map all the color names to their integer codes, and integer codes to the
color names.  The eight base names map to the foreground color codes, as
do names prefixed with `<TT>fg-</TT>', such as `<TT>fg-red</TT>'.  Names prefixed
with `<TT>bg-</TT>', such as `<TT>bg-blue</TT>', refer to the background codes.  The
reverse mapping from code to color yields base name for foreground codes
and the <TT>bg-</TT> form for backgrounds.
<P>

Although it is a misnomer to call them `colors', these arrays also map the
other fourteen attributes from names to codes and codes to names.
</P>
<P>

</P>
<DT>fg
<DD><DT>fg_bold
<DD><DT>fg_no_bold
<DD>Map the eight basic color names to ANSI terminal escape sequences that set
the corresponding foreground text properties.  The <TT>fg</TT> sequences change
the color without changing the eight intensity attributes.
<P>

</P>
<DT>bg
<DD><DT>bg_bold
<DD><DT>bg_no_bold
<DD>Map the eight basic color names to ANSI terminal escape sequences that set
the corresponding background properties.  The <TT>bg</TT> sequences change the
color without changing the eight intensity attributes.
<P>

</DL>
<P>

In addition, the scalar parameters <TT>reset_color</TT> and <TT>bold_color</TT> are
set to the ANSI terminal escapes that turn off all attributes and turn on
bold intensity, respectively.
</P>
<P>

<A NAME="IDX1546"></A>
</P>
<DT><TT>fned</TT> <VAR>name</VAR>
<DD>Same as <TT>zed -f</TT>.  This function does not appear in the zsh
distribution, but can be created by linking <TT>zed</TT> to the name <TT>fned</TT>
in some directory in your <TT>fpath</TT>.
<P>

<A NAME="IDX1547"></A>
</P>
<DT><TT>is-at-least</TT> <VAR>needed</VAR> [ <VAR>present</VAR> ]
<DD>Perform a greater-than-or-equal-to comparison of two strings having the
format of a zsh version number; that is, a string of numbers and text with
segments separated by dots or dashes.  If the <VAR>present</VAR> string is not
provided, <TT>$ZSH_VERSION</TT> is used.  Segments are paired left-to-right in
the two strings with leading non-number parts ignored.  If one string has
fewer segments than the other, the missing segments are considered zero.
<P>

This is useful in startup files to set options and other state that are
not available in all versions of zsh.
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>is-at-least 3.1.6-15 &amp;&amp; setopt NO_GLOBAL_RCS
is-at-least 3.1.0 &amp;&amp; setopt HIST_REDUCE_BLANKS
is-at-least 2.6-17 || print &quot;You can't use is-at-least here.&quot;
</pre></td></tr></table><P>

<A NAME="IDX1548"></A>
</P>
<DT><TT>nslookup</TT> [ <VAR>arg</VAR> ... ]
<DD>This wrapper function for the <TT>nslookup</TT> command requires the
<TT>zsh/zpty</TT> module (see
<A HREF="zsh_21.html#SEC159">21.22 The zsh/zpty Module</A>).  It behaves exactly like the standard <TT>nslookup</TT>
except that it provides customizable prompts (including a right-side
prompt) and completion of nslookup commands, host names, etc. (if you use
the function-based completion system).  Completion styles may be set with
the context prefix `<TT>:completion:nslookup</TT>'.
<P>

See also the <TT>pager</TT>, <TT>prompt</TT> and <TT>rprompt</TT> styles below.
</P>
<P>

</P>
<DT><TT>run-help</TT>
<DD>See `Accessing On-Line Help'
(<A HREF="zsh_23.html#SEC181">23.2 Utilities</A>).
<P>

<A NAME="IDX1549"></A>
</P>
<DT><TT>zed</TT> [ <TT>-f</TT> ] <VAR>name</VAR>
<DD>This function uses the ZLE editor to edit a file or function.  It rebinds
the return key to insert a line break, and adds bindings for `<TT>^X^W</TT>' in
the <TT>emacs</TT> keymap and `<TT>ZZ</TT>' in the <TT>vicmd</TT> keymap to accept (and
therefore write, in the case of a file) the edited file or function.
Keybindings are otherwise the standard ones; completion is available, and
styles may be set with the context prefix `<TT>:completion:zed</TT>'.
<P>

Only one <VAR>name</VAR> argument is recognized (additional arguments are
ignored).  If the <TT>-f</TT> option is given, the name is taken to be that of
a function; if the function is marked for autoloading, <TT>zed</TT> searches
for it in the <TT>fpath</TT> and loads it.  Note that functions edited this way
are installed into the current shell, but <EM>not</EM> written back to the
autoload file.
</P>
<P>

Without <TT>-f</TT>, <VAR>name</VAR> is the path name of the file to edit, which need
not exist; it is created on write, if necessary.
</P>
<P>

<A NAME="IDX1550"></A>
<A NAME="IDX1551"></A>
</P>
<DT><TT>zcp</TT> [ <TT>-finqQvw</TT> ] <VAR>srcpat</VAR> <VAR>dest</VAR>
<DD><DT><TT>zln</TT> [ <TT>-finqQsvw</TT> ] <VAR>srcpat</VAR> <VAR>dest</VAR>
<DD>Same as <TT>zmv -C</TT> and <TT>zmv -L</TT>, respectively.  These functions do not
appear in the zsh distribution, but can be created by linking <TT>zmv</TT> to
the names <TT>zcp</TT> and <TT>zln</TT> in some directory in your <TT>fpath</TT>.
<P>

</P>
<DT><TT>zkbd</TT>
<DD>See `Keyboard Definition'
(<A HREF="zsh_23.html#SEC181">23.2 Utilities</A>).
<P>

<A NAME="IDX1552"></A>
</P>
<DT><TT>zmv</TT> [ <TT>-finqQsvw</TT> ] [ -C | -L | -M | -p <VAR>program</VAR> ] [ -o <VAR>optstring</VAR> ] <VAR>srcpat</VAR> <VAR>dest</VAR>
<DD>Move (usually, rename) files matching the pattern <VAR>srcpat</VAR> to
corresponding files having names of the form given by <VAR>dest</VAR>, where
<VAR>srcpat</VAR> contains parentheses surrounding patterns which will be
replaced in turn by $1, $2, ... in <VAR>dest</VAR>.  For example,
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>zmv '(*).lis' '$1.txt'
</pre></td></tr></table><P>

renames `<TT>foo.lis</TT>' to `<TT>foo.txt</TT>', `<TT>my.old.stuff.lis</TT>' to
`<TT>my.old.stuff.txt</TT>', and so on.
</P>
<P>

The pattern is always treated as an <TT>EXTENDED_GLOB</TT> pattern.  Any file
whose name is not changed by the substitution is simply ignored.  Any
error (a substitution resulted in an empty string, two substitutions gave
the same result, the destination was an existing regular file and <TT>-f</TT>
was not given) causes the entire function to abort without doing anything.
</P>
<P>

Options:
</P>
<P>

</P>
<DL COMPACT>
<DT><TT>-f</TT>
<DD>Force overwriting of destination files.  Not currently
passed down to the <TT>mv</TT>/<TT>cp</TT>/<TT>ln</TT> command due to vagaries of
implementations (but you can use <TT>-o-f</TT> to do that).
<DT><TT>-i</TT>
<DD>Interactive: show each line to be executed and ask the user
whether to execute it.  `Y' or `y' will execute it, anything else will
skip it.  Note that you just need to type one character.
<DT><TT>-n</TT>
<DD>No execution: print what would happen, but don't do it.
<DT><TT>-q</TT>
<DD>Turn bare glob qualifiers off: now assumed by default, so
this has no effect.
<DT><TT>-Q</TT>
<DD>Force bare glob qualifiers on.  Don't turn this on unless
you are actually using glob qualifiers in a pattern.
<DT><TT>-s</TT>
<DD>Symbolic, passed down to <TT>ln</TT>; only works with <TT>-L</TT>.
<DT><TT>-v</TT>
<DD>Verbose: print each command as it's being executed.
<DT><TT>-w</TT>
<DD>Pick out wildcard parts of the pattern, as described above,
and implicitly add parentheses for referring to them.
<DT><TT>-C</TT>
<DD><DT><TT>-L</TT>
<DD><DT><TT>-M</TT>
<DD>Force <TT>cp</TT>, <TT>ln</TT> or <TT>mv</TT>, respectively, regardless of
the name of the function.
<DT><TT>-p</TT> <VAR>program</VAR>
<DD>Call <VAR>program</VAR> instead of <TT>cp</TT>, <TT>ln</TT> or
<TT>mv</TT>.  Whatever it does, it should at least understand the form
<TABLE><tr><td>&nbsp;</td><td class=example><pre><VAR>program</VAR> <TT>-</TT><TT>-</TT> <VAR>oldname</VAR> <VAR>newname</VAR>
</pre></td></tr></table>where <VAR>oldname</VAR> and <VAR>newname</VAR> are filenames generated by <TT>zmv</TT>.
<DT><TT>-o</TT> <VAR>optstring</VAR>
<DD>The <VAR>optstring</VAR> is split into words and
passed down verbatim to the <TT>cp</TT>, <TT>ln</TT> or <TT>mv</TT> command called to
perform the work.  It should probably begin with a `<TT>-</TT>'.
</DL>
<P>

For more complete examples and other implementation details, see the
<TT>zmv</TT> source file, usually located in one of the directories named in
your <TT>fpath</TT>, or in <TT>Functions/Misc/zmv</TT> in the zsh distribution.
</P>
<P>

</P>
<DT><TT>zrecompile</TT>
<DD>See `Recompiling Functions'
(<A HREF="zsh_23.html#SEC181">23.2 Utilities</A>).
<P>

<A NAME="IDX1553"></A>
</P>
<DT><TT>zstyle+</TT> <VAR>context</VAR> <VAR>style</VAR> <VAR>value</VAR> [ + <VAR>subcontext</VAR> <VAR>style</VAR> <VAR>value</VAR> ... ]
<DD>This makes defining styles a bit simpler by using a single `<TT>+</TT>' as a
special token that allows you to append a context name to the previously
used context name.  Like this:
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>zstyle+ ':foo:bar' style1 value1 \ 
      + ':baz'     style2 value2 \ 
      + ':frob'    style3 value3
</pre></td></tr></table><P>

This defines `style1' with `value1' for the context <TT>:foo:bar</TT> as usual,
but it also defines `style2' with `value2' for the context
<TT>:foo:bar:baz</TT> and `style3' with `value3' for <TT>:foo:bar:frob</TT>.  Any
<VAR>subcontext</VAR> may be the empty string to re-use the first context
unchanged.
</P>
<P>

</DL>
<P>

</P>
<P>

<HR SIZE="6">
<A NAME="SEC194"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC193"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 23.5.2 Styles </H3>
<!--docid::SEC194::-->
<P>

</P>
<DL COMPACT>
<A NAME="IDX1554"></A>
<DT><TT>insert-tab</TT>
<DD>The <TT>zed</TT> function <EM>sets</EM> this style in context `<TT>:completion:zed:*</TT>'
to turn off completion when <TT>TAB</TT> is typed at the beginning of a line.
You may override this by setting your own value for this context and style.
<P>

<A NAME="IDX1555"></A>
</P>
<DT><TT>pager</TT>
<DD>The <TT>nslookup</TT> function looks up this style in the context
`<TT>:nslookup</TT>' to determine the program used to display output that does
not fit on a single screen.
<P>

<A NAME="IDX1556"></A>
<A NAME="IDX1557"></A>
</P>
<DT><TT>prompt</TT>
<DD><DT><TT>rprompt</TT>
<DD>The <TT>nslookup</TT> function looks up this style in the context
`<TT>:nslookup</TT>' to set the prompt and the right-side prompt, respectively.
The usual expansions for the <TT>PS1</TT> and <TT>RPS1</TT> parameters may be used
(see
<A HREF="zsh_12.html#SEC39">12. Prompt Expansion</A>).
<P>

</DL>
<A NAME="Concept Index"></A>
<HR SIZE="6">
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_23.html#SEC179"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_24.html#SEC195">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="zsh_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Peter Stephenson</I> on <I>August, 9 2002</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</FONT>

</BODY>
</HTML>