Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Force file completion when hitting TAB twice
- X-seq: zsh-users 14662
- From: Yuri D'Elia <wavexx@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Force file completion when hitting TAB twice
- Date: Fri, 18 Dec 2009 13:06:52 +0100
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20091217175808.2e860888@xxxxxxxxxxxxxxxxxxx> <20091218104616.49dafffa@news01> <200912181121.nBIBLIf9005083@xxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
On Fri, 18 Dec 2009 11:21:18 +0000
Peter Stephenson <pws@xxxxxxx> wrote:
> Peter Stephenson wrote:
> > zstyle ':completion:*' completer _complete _complete-failed
> ^
> Sorry, obvious typo here: that should be an underscore. Tried the
> following explicitly to make sure it did what I expected:
>
>
> _complete_failed() {
> # Only complete if first attempt at completion failed.
> # Usage:
> # zstyle ':completion:*' completer _complete _complete-failed
> # zstyle ':completion:complete-failed:*' completer
> <your-completers>
>
> if [[ $LASTWIDGET = *complete* && -z $_complete_failed_active ]];
> then local _complete_failed_active=1
> local -a completers
> local curcontext="complete-failed:::"
> _main_complete "${completers[@]}"
> fi
> }
> zstyle ':completion:*' completer _complete _complete_failed
> zstyle ':completion:complete-failed:*' completer _files
Very nice! But I still cannot complete with _files in some contextes.
Just to let you understand: sometimes some completion widgets try to be
smart and don't allow to complete all files. Mostly, these are bugs
in the completion widget. I try to track down the problem usually, but
it happened to me too many times in the past. I don't always have
the time, I simply want to 'get on' and debug later.
The 'git' completion is such and example of recurring headache.
git status [TAB TAB] still doesn't offer me a list of files with this
code (others, like ssh, do).
Ideas?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author