https://github.com/zdharma-continuum/zsh-util-lib
https://github.com/zdharma-continuum/zsh-util-lib
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/zdharma-continuum/zsh-util-lib
- Owner: zdharma-continuum
- License: other
- Created: 2021-11-08T12:32:31.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-16T03:00:13.000Z (over 3 years ago)
- Last Synced: 2025-04-08T00:09:22.833Z (over 1 year ago)
- Language: Shell
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [zsh-util-lib](#zsh-util-lib)
- [List Of The Functions](#list-of-the-functions)
- [@util-bind-all](#util-bind-all)
# zsh-util-lib
An utility-library for Zshell that provides a few general-purpose functions. It's a counterpart to the
[zsh-string-lib](https://github.com/zdharma/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.
1. 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.
1. (Optional) Custom snippet of code to be executed **after** executing the original widget.
1. (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!'
```