zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-users@sunsite.dk
Subject: Re: what zshcompsys-syntax is equals compctl -C -f ?
Date: Fri, 4 Nov 2005 10:33:00 +0000	[thread overview]
Message-ID: <20051104103300.79aefefb.pws@csr.com> (raw)
In-Reply-To: <436B2B11.1070503@atlas.de>

Eike Kroemer <kroemer@atlas.de> wrote:
> I used "compctl -C -f" to avoid path-lookup in completion.
> For example assume my $PWD has a subdirectory "bin/" and I want to call
> "Script" located in this dir.

So you want local directories (not using CDPATH), and any executable
files in them, right?

Try adding:

  _local_exes() {
    _files -g "*(*)"
  }
  compdef _local_exes -command-

after the point where "compinit" runs.  This makes command context
(which means basically what you think) run your function instead of the
default.  The function uses a glob qualifier to match all executable files.
The _files function automatically lets you search for the file in subdirectories
(in fact, I've discovered I'm a bit vague on how to stop it doing that,
but luckily you don't need to).

All sorts of variations are possible.  You should be able to get away with
putting a suitable function in your $fpath, but I couldn't get that to work
(it get being overridden however I organised my fpath and deleted the
dumped configuration), so just stick with the lines above or similar.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com


      parent reply	other threads:[~2005-11-04 10:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-04  9:34 Eike Kroemer
2005-11-04 10:21 ` DervishD
2005-11-04 10:33 ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051104103300.79aefefb.pws@csr.com \
    --to=pws@csr.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).