zsh-users
 help / color / mirror / code / Atom feed
* Completion on word prefix only (tcsh-style)
@ 1998-02-18 22:55 Steve Talley
  1998-02-19  8:50 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Talley @ 1998-02-18 22:55 UTC (permalink / raw)
  To: zsh-users

Hi,

Is there an option to force zsh to only look at a prefix on
completion?  This seems to be the default in tcsh, but I can't get it
to work for zsh.

Example:

Suppose there is a lone file blah.txt in the current dir:

% ls
./     ../    blah.txt

If I hit [TAB] in the following example, with the cursor over the first
x, I get a beep and no completion.

% ls blxxx
       ^

In tcsh, however, it completes to:

% ls blah.txt xxx
              ^

And keeps the cursor over the first x.  Basically what tcsh does is
assume that the word suffix (anything after the cursor) is a different
word, and just completes on the word prefix.  Is there a way to get zsh
to do this too?

BTW, the COMPLETE_IN_WORD option sounded good but didn't do the trick.

Thanks,

Steve


^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: Completion on word prefix only (tcsh-style)
@ 1998-02-20  2:31 Steve Talley
  0 siblings, 0 replies; 3+ messages in thread
From: Steve Talley @ 1998-02-20  2:31 UTC (permalink / raw)
  To: zsh-users, pws

> > Is there an option to force zsh to only look at a prefix on
> > completion?  This seems to be the default in tcsh, but I can't get it
> > to work for zsh.
> 
> The command is called expand-or-complete-prefix.  If you bind it to
> tab, you will probably get something like tcsh behaviour.

This appeared to work initially, but now completion for "cd" doesn't
work beyond the first directory level:

With expand-or-complete-prefix:

% cd /etc/[TAB]

produces no matches.

With expand-or-complete, it works fine:

% cd /etc/[TAB]
acct/      fn/        lp/        rc2.d/     snmp/
cron.d/    fs/        mail/      rc3.d/     tm/
default/   http/      net/       rcS.d/     uucp/
dfs/       inet/      openwin/   saf/
dhcp/      init.d/    opt/       security/
dmi/       lib/       rc0.d/     skel/
dt/        log@       rc1.d/     ski/

I'm using the simple completion

compctl -g '*(-/)' cd

Is this a bug?

Thanks,

Steve


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-02-20  2:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-18 22:55 Completion on word prefix only (tcsh-style) Steve Talley
1998-02-19  8:50 ` Peter Stephenson
1998-02-20  2:31 Steve Talley

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).