From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14169 invoked by alias); 10 Sep 2013 15:09:12 -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: 17976 Received: (qmail 16632 invoked from network); 10 Sep 2013 15:08:55 -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: <130910080852.ZM9661@torch.brasslantern.com> Date: Tue, 10 Sep 2013 08:08:52 -0700 In-reply-to: Comments: In reply to Leonardo Barbosa "Re: custom completion for listing *.tex is not working" (Sep 9, 8:49am) References: <130903073216.ZM27351@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Leonardo Barbosa Subject: Re: custom completion for listing *.tex is not working Cc: zsh-users@zsh.org MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 9, 8:49am, Leonardo Barbosa wrote: } } zstyle ':completion:*:*:vi:*' file-patterns '*.tex:TeX-files' '%p:all-files' } } However, by doing so, it only through TeX files. Yes, note from the example in the manual "if there is no matching file": For example, to make the rm command first complete only names of object files and then the names of all files if there is no matching object file What the manual doesn't make clear is that file-patterns may have its values combined in sets the same way tag-order might. So start by removing a couple of quotes: zstyle ':completion:*:*:vi:*' file-patterns '*.tex:TeX-files %p:all-files' Next you need to tell completion that even though all those tags are to be combined into a single listing, you still want the files separated into groups within the listing: zstyle ':completion:*:*:vi:*' group-name '' (The empty string here is a shorthand for "automatically use the tag names as the group names, so I don't have to repeat all of that.") This will get you the TeX-files group first, followed by the all-files group, all within one listing that you can tab through. } An just one more question, how can i make zsh to highlight the } selected file in the menu while cycling through files? Assuming you want this everywhere and not just for vi: zstyle ':completion:*' menu select=2 This will enter highlighted selection if there are 2 or more matches. Selection normally starts on the second press of tab (which has nothing to do with select=2); add "yes=1" if you want it to start immediately on the first tab. There are a whole lot of other details controlled with the menu style; you might want "yes=long" instead, or a value larger than select=2, etc.