Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: completion with globbing, take 2



On Sep 17,  1:50pm, E. Jay Berkenbilt wrote:
}
} Several days ago, I wanted to know how I could get zsh to respond to 
} 
} something *TAB
} 
} by replacing the * with the list everything that the completion system
} would return instead of everything * would match in the current
} directory.  I was told to do this:
} 
} zstyle ':completion:*' completer _oldlist _complete _match
} bindkey "^I" complete-word

More precisely, you were told that Andrej does that.

Andrej probably wasn't expecting you to use it verbatim, though, because
he didn't show you what his settings for the matcher-list style are.  You
didn't say whether you have any settings for matcher-list; if you don't,
the _match completer won't do anything.

} I want behavior more like what expand-or-complete does except that I
} want only what the completion system would return to be substituted.

That's what the _expand completer is for.  I believe you want:

zstyle ':completion:*' completer _oldlist _expand _complete _match
zstyle ':completion::expand:*' completions true

And maybe you don't even need the _match on the end, if you haven't
worked out any matcher-list values yet.  The _match completer is for
doing things like case-insensitive completion and completion of sub-
parts of file names (e.g., completing on both sides of a ".").

You probably also want to read about the following styles:

    accept-exact
    add-space
    completions
    glob
    keep-prefix
    sort
    subst-globs-only
    substitute
    suffix

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author