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

Re: Slow completion



On 07/03/2013, Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> On Wed, 06 Mar 2013 22:40:41 +0100
> Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx> wrote:
>
>> Zsh completion has always been kind of slow for me (in comparison to
>> bash) but I always contributed this to the superior functionality (my
>> .zshrc is two and a half times as long as my .bashrc).
>>
>> Today I decided that it had become unbearable and started investigating.
>>
>> I tested a simple completion like
>>
>>     /us<TAB>r/bi<TAB>n/cada<TAB>ver.exe
>>
>> The directory completion (usr and bin) was already slow but the
>> executable (cadaver.exe) took ages.
>>
>> 1. Testing revealed that "setopt path_dirs" was responsible for the slow
>> directory completion.
>>
>> The zshoptions manual page says that path_dirs should not apply in the
>> above case[1] but a Process Monitor log showed that Zsh was actually
>> searching through the whole executable path.
>
> It's doing completion equivalent to:
>
> /usr*/bin*/cada*
>
> when you hit TAB in the last case.  This is a feature, but definitely
> annoying in the case where path completion is slow.  You can turn it off
> for the case where the directories exist by setting the style
> accept-exact-dirs to true: I've been doing this under Cygwin.  In other
> words, this should complete /usr/bin/cadaver.exe faster the way you're
> doing it, since it's one component at a time, but still allows you to
> complete /u/b/c in one go.
>
> I don't think we have an option to turn completion of all path segments
> off altogether at the moment.

Isn't that what this does?

       accept-exact-dirs
...
              If you wish to inhibit this behaviour entirely, set the
path-comple‐
              tion style (see below) to false.

       path-completion
              Explicitly setting this style to false inhibits this behaviour for
              path components up to the / before the cursor; this
overrides the set‐
              ting of accept-exact-dirs.


-- 
Mikael Magnusson



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