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

Re: Ignoring ~ when expanding scripts



I wrote:
> Chris Laas wrote:
> > A hack like this:
> > 
> > compctl -C -g '*[^~](*)' + -c
> > 
> > when combined with the "hash -f ; unhash -m '*~'" hack, gives something
> > like the desired result, though it incorrectly completes for matching
> > executable files in the current directory, even if it is not (and it
> > should not be) in your PATH.  Anyone know how to fix that?
> 
> compctl -C -c -x 'C[0,*/*]' -g '*[^~](*)' + -g '*(*)'
> 
> The last *(*) is a fallback.  If the typed in prefix does not match
> anything without a tilde, then, like fignore, it'll try to complete
> allowing tilde.

The above is still not perfect since it does not complete directories after
one typed any slash.  A better solution is

compctl -C -c -x 'C[0,*/*]' -g '*[^~](*)' + -c

Zoltan



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