Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: completion question



> Maybe what is bothering him is that if you do
>
>      /u_local/
>        ^--- cursor (no space)
> and press TAB, nothing is completed. If you enter a slash,
> however, it works:
>
>     /u/_local/          (or /u_/local/)
> is completed to
>     /usr/local/
>

Ah, I see. Well, somebody else have to answer this. I guess, this is what
_prefix completer is for, but I never used it. As a quick try (assuming, you
are using new completion):

bor@itsrm2% setopt completeinword
bor@itsrm2% zstyle ':completion:*' completer _oldlist _prefix _complete
_match
bor@itsrm2% l /usTABcal
bor@itsrm2% l /usr/cal
                             ^ cursor here

It still behaves differently; zsh totally ignores suffix, while bash not.
Next TAB in above example gives you

in bash:

MW1G017@MW1G17C ~
$ ls /usr/cal
bin             include         local           share
doc             info            logs            src
etc             lib             man             ssl
i686-pc-cygwin  libexec         sbin            tmp

in zsh:

bor@itsrm2% l /usr/TT_DB/cal
Completing files
TT_DB/       add-on/      adm@         admin/       bin/         ccs/
crash@       dt@          games/       ic/          include/     lbin/
lib/         lib64s/      local/       lost+found/  mail@        menus/
net/         news@        oasys/       opt/         options@     pkg/
preserve@    pub@         sadm/        sbin/        share/       spool@
src/         sysadm/      tmp@         ucb/         ucbinclude/  ucblib/
vmsys/

(ignore list settings).

I do not know how to make them behave identically.

OTOH in zsh you do not need to go back; just say /u/bTAB and it will be
completed to /usr/bing. Much better :-)

-andrej



Messages sorted by: Reverse Date, Date, Thread, Author