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

Custom auto complete


I wold like to write my own zsh auto complete function/code but i need some
reference to start with. This is is what i want to do:

I wold like to parse the command that is currently typed and if there is a
"?" char followed by a <TAB> key press to show a menu of options to
compete. So for example if I start typing:

> cp ?<TAB>

i would like zsh to shows me a menu of strings to replace the "?" char
with. Options would also have to be numerated so it would possible to write:

>cp ?1<TAB>

The strings I would like to be displayed would be stored in a file.

If found some tutorials on how to write my own auto complete functions but
the problem is I want this to work anywhere in the command string that is
currently typed not just if i start with that command.

I understand that the "?" char might have to be escaped or something but
it's not important that the "trigger" char is "?" it can be something else.

So my question is how do i get zsh to display a custom auto complete menu
when I press <TAB> and the previous char is, for example, "?".


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