Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion within word
- X-seq: zsh-users 8029
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- Subject: Re: completion within word
- Date: Mon, 27 Sep 2004 17:12:24 +0200
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20040927164336.557f6485@xxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040921175108.5a5f7697@xxxxxxxxxxxxxxxxxxxxx> <20040922045511.GA22277@xxxxxxxxxxxxxxxxx> <20040925003747.241f4a2d@xxxxxxxxxxxxxxxxxxxxx> <17298.1096276791@xxxxxxxxxxxxxxxxxxxxx> <20040927160024.5a664979@xxxxxxxxxxxxxxxxxxxxx> <200409271418.i8REIoZf009904@xxxxxxxxxxxxxx> <20040927164336.557f6485@xxxxxxxxxxxxxxxxxxxxx>
"Matthias B." wrote:
> On Mon, 27 Sep 2004 15:18:49 +0100 Peter Stephenson <pws@xxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author