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

Re: Completion of ~ to include dirstack?



On Oct 7,  1:23pm, Boyd Adamson wrote:
} Subject: Completion of ~ to include dirstack?
}
} What I'd really like is this completion:
} 
} % cd ~<tab>
} 
} to include a section with the directory stack.

Type ctrl-x h instead of tab and you'll see something like:

% cd ~
tags in context :completion::complete:-tilde-::
    users named-directories directory-stack  (_tilde) 
    users                                    (_users _tilde)

This indicates that tilde completion is already considering the
directory stack for inclusion.  Ordinarly you'd control what appears
in the listing with

    zstyle :completion::complete:-tilde-:: tag-order ...

and the order in which they appear with

    zstyle :completion::complete:-tilde-:: group-order ...

However, in this case the directory stack is being handled by the
_directory_stack completer, and that completer ignores strings that
do not match "[-+]*", so with just a bare tilde none of the stack
entries are considered candidates.

So the only way to get what you want is to rewrite _directory_stack,
or rewrite _tilde to call something else to get the stack entries.



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