This repository is archived and unmaintained. Its last functional change was
in January 2023 and no consumer of it is known. The code still works and stays
readable here; copy @util-bind-all into your own configuration if you want it.
@util-bind-all rebinds every key binding so each one runs an extra snippet of
code, as an alternative to overloading every Zle widget. The closest maintained
feature in the ecosystem is Zi's bindmap ice,
but the two are not equivalent: bindmap remaps specific keys for a single
plugin, while @util-bind-all wraps all bindings globally. Neither replaces the
other.
An utility-library for Zshell that provides a few general-purpose functions. It's a counterpart to the zsh-string-lib library.
Rebinds all key bindings so that they're executing some custom code. It's an alternative to overloading of all Zle widgets.
Arguments:
- The custom snippet of code to run before executing the original widget.
- A bool (
1,yes,true,onfor truth or other value for false) indicating whether the widget calls should be automatically forwarded to their original (before-binding) versions. - (Optional) Custom snippet of code to be executed after executing the original widget.
- (Optional) A method of the binding – either
bindkey(the default) orzle-N. The first one is fully bindkey based, i.e.: e.g.: it doesn't create the backup widgets that are typically prefixed with "orig–". The second is half-bindkey / half-zle -N based - it does create the backup widgets, however the widgets are obtained usingbindkeylisting invocation, which means that typically only a half of all widgets are bound.
Example:
@util-bind-all 'print hello!' yes 'print hello after!'