1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 22:11:54 +02:00

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.
This commit is contained in:
Peter Stephenson 2020-01-11 14:07:19 +00:00
parent 70d6d0d86c
commit 2ce5f6d79a
2 changed files with 19 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2020-01-11 Peter Stephenson <p.stephenson@samsung.com>
* users/24628 (fixed up): Doc/Zsh/contrib.yo: Add example of how
to bind word matching widget with a fixed style.
2020-01-10 Daniel Shahaf <danielsh@apache.org>
* 45266: Completion/Linux/Command/_losetup: Fix losetup

View file

@ -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