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

Re: Adding file name completions



On Tue, 25 Jan 2011 00:50:08 -0500
Jean-Rene David <jeanrene.david@xxxxxxxxx> wrote:
> If I type a command name followed by <tab> and I find the completer for
> that command doesn't complete filenames, is there a way to tell zsh to
> add filename completion?

Your simplest bet is to have a separate function to complete files,
else you would need to modify the completion function directly.  The
following binds this to C-x f.

zle -C complete-file complete-word _generic
zstyle ':completion:user-expand:*' completer _user_expand
zstyle ':completion:complete-file:*' completer _path_files
bindkey '^xf' complete-file

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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