From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1202 invoked by alias); 27 Feb 2013 03:26:46 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17655 Received: (qmail 18021 invoked from network); 27 Feb 2013 03:26:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <130226192629.ZM5352@torch.brasslantern.com> Date: Tue, 26 Feb 2013 19:26:29 -0800 In-reply-to: Comments: In reply to joe M "Re: Zsh completion configuration" (Feb 26, 7:41pm) References: <130226080545.ZM4526@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Zsh completion configuration MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Feb 26, 7:41pm, joe M wrote: } } > And then install it for the context: } > } > compdef _history_or_autocd -command- } } I do not understand the "install" process. Is it good enough to have } the function file (_history_or_autocd) anywhere in the $fpath? Or, } does it have to be after the directory with _autocd? Sorry, I wrote that as if you were going to put it in ~/.zshrc. To put it in a file by itself, it has to be in a directory in $fpath that is listed BEFORE the directory containing _autocd, and the file should look like #compdef -command- _history local ret=$? _autocd || return ret (without the indentation, of course). } I added this "zstyle ':completion::complete:-command-:*' } _history_or_autocd" to my zshrc No, you don't need that. Either the compdef command in ~/.zshrc, or the file formatted as above with #compdef, is all that's necessary. } Just a rehash did not do the job. Any thoughts, please? Rehash doesn't reload functions, nor does it reset completion definitions (the _comps variable). To install just the one function, use compdef as a command. To reload the entire completion system, delete ~/.zcompdump and run "compinit" (which has the effect of executing a whole bunch of "compdef" commands computed from the #compdef lines). -- Barton E. Schaefer