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

Re: completion question



dLux wrote:

> ...
> 
> Yes,  absolutely.  I   don't  have  chance  to  read   the  whole  zsh
> documentation, it is very huge!
> 
> I want  zsh to ignore the  "local/" part of the  example, and complete
> the word as I want...

If you use compctl-based completions, just use another key binding:

  bindkey '^I' expand-or-complete-prefix

That `-prefix' means that it will ignore the `suffix', i.e. the part
after the cursor when completing.

If you use the new completion system (the one invoked by `compinit'),
then, as Andrej pointed out, you want to use the _prefix completer which
does the same. You set that up with:

  zstyle ':completion:*' completer _complete _prefix

to make it try normal completion (from both ends if `completeinword' is
set) first, or by using the _prefix completer exclusively:

  zstyle ':completion:*' completer _prefix
  zstyle ':completion:*:prefix:*' completer _complete

(or whichever completer you use or compinstall has set up for you).


Bye
  Sven


-- 
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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