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

Re: A couple completion glitches



On Jun 25,  1:38am, Wayne Davison wrote:
} Subject: Re: A couple completion glitches
}
} On Sat, 24 Jun 2000, Bart Schaefer wrote:
} > You DO need to set the suffix style, but you need to set it to "false".
} 
} This has an unfortuante side-effect.
} 
}     % ls ~/foo<tab>
} 
} This becomes:
} 
}     % ls /home/wayne/foo
}     /home/wayne/foo
}     ~/foo
} 
} Which is not what I want at all.

That's because the keep-prefix style defaults to "changed" which means
that the prefix expands if and only if the suffix does not.  So you also
want

    zstyle ':completion:*:expand:*' keep-prefix true

which means to never expand the prefix.

} It still seems strange to me that (without the above suffix option)
} foo* gets glob expansion but ~/foo* does not.  Surely this should not
} be the default even if this turns out (for some strange reason) not to
} be a bug.

I never noticed this myself because using

    zstyle ':completion:*' matcher-list '' 'r:|[._-,]=* r:|=*'
    zstyle ':completion:*' completer _expand _complete _match

causes most glob expansions to occur during the matching phase.

In light of the examples you've given, I think the suffix style should
have its meaning completely reversed (which probably means we ought to
change its name, sigh) so that the default is to expand the suffix and
the setting "false" means to NOT expand it.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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