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

Re: _files vs _path_files discussion (old thread)



On Mar 11, 10:22pm, Adam Spiers wrote:
} Subject: Re: _files vs _path_files discussion (old thread)
}
} > > A second issue is whether, if you find target files in the current
} > > directory, you might still want to complete directories.
} 
} Does the new zstyle stuff now provide some kind of configurability to
} solve this issue?

Yes, it's the tag-order style.

} Suppose I have, in the cwd, a file `foo.tar.gz' and a directory `foo'.
} I type:
} 
}   $ tar zxf foo<TAB>
} 
} Currently, this immediately completes to `foo.tar.gz'.  But what if I
} actually wanted to extract a .tar.gz from somewhere within the
} directory foo?

zstyle ':completion::complete:tar::' \
	tag-order 'globbed-files directories all-files'

By putting all the tags in the same argument, they're all treated as
equal for purposes of completions.  You could also do

zstyle ':completion::complete:tar::' \
	tag-order 'globbed-files directories' all-files

(that is, put all-files in a separate argument) to get shown all possible
files only if there are no globbed-files or directories.  The default is
as if you had

zstyle ':completion::complete:tar::' \
	tag-order globbed-files directories all-files

(that is, all in separate arguments), which in turn depends on some of
the command-line options passed to _files by _tar (so it's not the same
for all completions that use _files).

} Incidentally, the more I understand of the new completion system, the
} more I like it.  [...]  Congratulations to everyone involved,
} especially (needless to say) Sven!

Right, three cheers for Sven!  And thanks.

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



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