zsh-users
 help / color / mirror / code / Atom feed
From: paxunix <paxunix@acm.org>
Cc: zsh-users@sunsite.dk
Subject: Re: How to get faster completion if I make zsh assume what I've typed so far is correct?
Date: Wed, 14 Apr 2004 23:52:20 -0400	[thread overview]
Message-ID: <407E06F4.6010301@acm.org> (raw)
In-Reply-To: <4073DAE5.6040904@acm.org>

paxunix wrote:

[ using  zstyle ':completion:*:paths' accept-exact '*' to avoid partial 
completion globs on directory elements ]

> There are a couple of very annoying issues with this solution:  
> ambiguous matches are not cycled through correctly and it is 
> impossible to complete some pathnames.  For example, if you have two 
> directories:
>
> dir1
> dir1~
>
> Typing dir<TAB> will complete up to 'dir1' and (in my case) show dir1 
> and dir1~ as possible completions.  Successively hitting TAB will 
> never cycle through to dir1~ - a trailing '/' is inserted after dir1 
> and zsh lists the contents of dir1 as possible completions.  It 
> appears that any common prefix to an initial path completion attempt 
> causes completion to continue inside the first directory match.  If 
> it's between a directory and a filename with a common prefix, things 
> work as they are supposed to.

On a hunch, I changed the '*' to '*(N)', so my resulting zstyle line became:

zstyle ':completion:*:paths' accept-exact '*(N)'

and so far this seems to do precisely what I want, without the above 
annoyances.  I especially noticed the difference when completing 
dotfiles in my home directory.  Without '*(N)', try:

ls ~/.<TAB>

and notice that none of the dotfiles are given as possible completions.  
Instead you get a trailing slash appended and then non-dotfile 
completions from the home directory.  With '*(N)', this works as expected.

-- 
Shawn Halpenny


  parent reply	other threads:[~2004-04-15  3:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-23 16:26 paxunix
2004-03-23 16:56 ` Aidan Kehoe
2004-03-23 17:06 ` Peter Stephenson
2004-03-24  3:37   ` paxunix
2004-04-07 10:41     ` paxunix
2004-04-07 11:41       ` Thorsten Kampe
2004-04-07 12:32         ` Oliver Kiddle
2004-04-14 20:04           ` Peter Stephenson
2004-04-15  3:52       ` paxunix [this message]
2004-04-15  4:05         ` paxunix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=407E06F4.6010301@acm.org \
    --to=paxunix@acm.org \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).