Zle Widgets (zsh)

### 18.4 Zle Widgets ¶

All actions in the editor are performed by ‘widgets’. A widget’s job is simply to perform some small action. The ZLE commands that key sequences in keymaps are bound to are in fact widgets. Widgets can be user-defined or built in.

The standard widgets built into ZLE are listed in Standard Widgets. Other built-in widgets can be defined by other modules (see Zsh Modules). Each built-in widget has two names: its normal canonical name, and the same name preceded by a ‘`.`’. The ‘`.`’ name is special: it can’t be rebound to a different widget. This makes the widget available even when its usual name has been redefined.

User-defined widgets are defined using ‘`zle -N`’, and implemented as shell functions. When the widget is executed, the corresponding shell function is executed, and can perform editing (or other) actions. It is recommended that user-defined widgets should not have names starting with ‘`.`’.