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

Re: zstyle problems



On Oct 1,  2:34pm, Jonas Juselius wrote:
} Subject: zstyle problems
}
} I wanted different completion for 'cd' and the rest of the commands. I
} put the following lines in my .zshrc:
} 
} zstyle ':completion:*:*:cd:*' completer _complete 
} zstyle ':completion:*' completer _complete _correct _approximate
} 
} But to my big surprise, I still get exactly the same completion (with
} corrections) for 'cd' and the other progs. Am I missing something here?

The individual command context is not yet established at the time the
completer style is looked up; more specifically, the completer style is
always checked with the context ":completion:::::" (except in specialty
widgets like insert-and-predict).  The precise context including the
command name (or contexts like "-tilde-") is actually set up *by* the
completers.

} I also tried to change tag-order for the [-tilde-] completer so that it
} would complete named directories before users, but that failed as
} well...

Hmm.  The following works for me:

    zstyle ':completion::complete:-tilde-:*' tag-order \
	    named-directories users directory-stack

-- 
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