diff options
| author | Peter Stephenson <p.stephenson@samsung.com> | 2020-01-11 14:07:19 +0000 |
|---|---|---|
| committer | Peter Stephenson <p.stephenson@samsung.com> | 2020-01-11 14:07:19 +0000 |
| commit | 2ce5f6d79a70060c65b2d1ff456e5b505309e0be (patch) | |
| tree | 6cb823beba806087bef83abcfbb4d7aa4439c948 /Doc | |
| parent | 45266: Fix losetup completion, broken in da085b7a20729401c725f91ae930200d0ded... (diff) | |
| download | zsh-2ce5f6d79a70060c65b2d1ff456e5b505309e0be.tar zsh-2ce5f6d79a70060c65b2d1ff456e5b505309e0be.tar.gz zsh-2ce5f6d79a70060c65b2d1ff456e5b505309e0be.tar.bz2 zsh-2ce5f6d79a70060c65b2d1ff456e5b505309e0be.tar.lz zsh-2ce5f6d79a70060c65b2d1ff456e5b505309e0be.tar.xz zsh-2ce5f6d79a70060c65b2d1ff456e5b505309e0be.tar.zst zsh-2ce5f6d79a70060c65b2d1ff456e5b505309e0be.zip | |
users/24628 (fixed): More doc for selectw-word-style widgets.
Add example of how to add a new binding for a widget that fixes
a particular word behaviour using styles.
Diffstat (limited to 'Doc')
| -rw-r--r-- | Doc/Zsh/contrib.yo | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 6a80cd253..c6bf745b7 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -2227,7 +2227,20 @@ is set in the context tt(:zle:*) to tt(true) if the word style is tt(bash) and tt(false) otherwise. It may be overridden by setting it in the more specific context tt(:zle:forward-word*). -Here are some examples of use of the styles, actually taken from the +It is possible to create widgets with specific behaviour by defining +a new widget implemented by the appropriate generic function, then +setting a style for the context of the specific widget. For example, +the following defines a widget tt(backward-kill-space-word) using +tt(backward-kill-word-match), the generic widget implementing +tt(backward-kill-word) behaviour, and ensures that the new widget +always implements space-delimited behaviour. + +example(zle -N backward-kill-space-word backward-kill-word-match +zstyle :zle:backward-kill-space-word word-style space) + +The widget tt(backward-kill-space-word) can now be bound to a key. + +Here are some further examples of use of the styles, actually taken from the simplified interface in tt(select-word-style): example(zstyle ':zle:*' word-style standard |
