GNU Info

Info Node: (zsh.info)Completion Widget Example

(zsh.info)Completion Widget Example


Prev: Matching Control Up: Completion Widgets
Enter node , (file) or (file)node

Completion Widget Example
=========================

The first step is to define the widget:

     zle -C complete complete-word complete-files

Then the widget can be bound to a key using the bindkey builtin command:

     bindkey '^X\t' complete

After that the shell function complete-files will be invoked after
typing control-X and TAB. The function should then generate the
matches, e.g.:

     complete-files () { compadd - * }

This function will complete files in the current directory matching the
current word.


automatically generated by info2www version 1.2.2.9