# zsh-util-lib **Repository Path**: zdharma/zsh-util-lib ## Basic Information - **Project Name**: zsh-util-lib - **Description**: A utility library for Z shell that provides a few general-purpose functions. It's a counterpart to the zsh-string-lib library - **Primary Language**: Shell - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-02-05 - **Last Updated**: 2024-08-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Zsh Util lib - [Introduction](#introduction) - [List Of The Functions](#list-of-the-functions) - [@util-bind-all](#util-bind-all) ## Introduction An utility-library for Zshell that provides a few general-purpose functions. It's a counterpart to the [zsh-string-lib](https://github.com/z-shell/zsh-string-lib) library. ## List Of The Functions ### @util-bind-all Rebinds all key bindings so that they're executing some custom code. It's an alternative to overloading of all Zle widgets. Arguments: 1. The custom snippet of code to run before executing the original widget. 2. A bool (`1`,`yes`,`true`,`on` for truth or other value for false) indicating whether the widget calls should be automatically forwarded to their original (before-binding) versions. 3. (Optional) Custom snippet of code to be executed **after** executing the original widget. 4. (Optional) A method of the binding – either `bindkey` (the default) or `zle-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 using `bindkey` listing invocation, which means that typically only a half of all widgets are bound. Example: ```zsh @util-bind-all 'print hello!' yes 'print hello after!' ```