Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Disable all-files completions in a directory
On Mar 3, 1:26pm, joe M wrote:
}
} Is it possible to disable completions on all-files in some directories?
Depends on what you mean by "in". (William J. Clinton, 1998)
If you mean "Is it possible to disable completions on all-files when
the value of $PWD matches certain directories?" then yes, you can use
zstyle -e to include/omit all-files from tag-order as necessary.
If you mean "... any time completion reaches certain directories, even
if I'm completing a path that begins somewhere above that directory in
the directory tree?" then the answer is probably no. However ...
You might experiment with using the file-patterns style to break up the
files into groups regardless of what directory you are in. For example:
zstyle ':completion:*' file-patterns \
'*([1,10]):first-ten-files' \
'*([11,30]):second-twenty-files' \
'*([31,-1]):all-remaining-files'
Now when you press TAB you'll be offered at most the first-ten-files.
You can advance to the next twenty with the _next_tags widget (bound
by default to control-x n), and then to all the rest of the files with
one more tap of ^Xn. If you combine this with, for example,
zstyle ':completion:*' file-sort modification
then you'll always be offered the ten most recent files, etc.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author