zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh-users@sunsite.dk
Subject: Re: completion within word
Date: Mon, 27 Sep 2004 17:12:24 +0200	[thread overview]
Message-ID: <19431.1096297944@trentino.logica.co.uk> (raw)
In-Reply-To: <20040927164336.557f6485@buddha.localdomain.de>

"Matthias B." wrote:
> On Mon, 27 Sep 2004 15:18:49 +0100 Peter Stephenson <pws@csr.com> wrote:
> 
> > "Matthias B." wrote:
> > > Pathname completion should *always* work *unconditionally* and
> > > everything else should be offered in addition to it, if the completion
> > > code believes it makes sense in the appropriate position.

Use _files as a completer. If you use a wrapper around _files, you can
make it return 1 causing later completers to get a go after it:

_files_first() {
  _files "$@"
  return 1
}
zstyle ':completion:*::::' completer _files_first _complete _ignored

It'll now always give you file completion. To solve the PATH colons
problems, add the compset commands in my later example.

> > You can bind a key that just does filename

> > Oliver may know some gotchas I'm missing.

Only that I'd use ':completion:complete-filename::::' as the context.

Also note that you can simply use:
  bindkey '\ef' _bash_complete-word

> I can tell you. It doesn't solve my original problem, which is that
> 
> BLA=/usr:/us<COMPLETE>

You can create a wrapper around _files to handle the colons:

_my_files() {
  compset -P '*:'
  compset -S ':*'
  _files "$@"
}

Oliver


  parent reply	other threads:[~2004-09-27 15:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-21 15:51 Matthias B.
2004-09-22  4:55 ` Thomas Köhler
2004-09-22  9:16   ` Peter Stephenson
2004-09-24 22:37   ` Matthias B.
2004-09-27  9:19     ` Oliver Kiddle
2004-09-27 14:00       ` Matthias B.
2004-09-27 14:18         ` Peter Stephenson
2004-09-27 14:43           ` Matthias B.
2004-09-27 14:46             ` Peter Stephenson
2004-09-27 15:12             ` Oliver Kiddle [this message]
2004-09-27 20:34               ` Joel David Elkins

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=19431.1096297944@trentino.logica.co.uk \
    --to=okiddle@yahoo.co.uk \
    --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).