1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-27 04:40:59 +01:00

15432: New bash-transpose-words widget

This commit is contained in:
Peter Stephenson 2001-07-20 13:04:51 +00:00
parent 79dbcc8382
commit 32f7b32061
3 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2001-07-20 Peter Stephenson <pws@csr.com>
* 15432: Functions/Zle/bash-transpose-words, Doc/Zsh/contrib.yo:
new bash-branspose-words widget.
2001-07-20 Sven Wischnowsky <wischnow@zsh.org>
* 15433: Src/Zle/computil.c: don't use compsuffix when it might

View file

@ -366,15 +366,17 @@ tindex(bash-forward-word)
tindex(bash-backward-word)
tindex(bash-kill-word)
tindex(bash-backward-kill-word)
tindex(bash-transpowse-words)
xitem(tt(bash-forward-word), tt(bash-backward-word))
item(tt(bash-kill-word), tt(bash-backward-kill-word))(
xitem(tt(bash-kill-word), tt(bash-backward-kill-word))
item(tt(bash-transpose-words))(
These work similarly to the corresponding builtin zle functions without the
`tt(bash-)' prefix, but a word is considered to consist of alphanumeric
characters only. If you wish to replace your existing bindings with these
four widgets, the following is sufficient:
example(for widget in kill-word backward-kill-word \
forward-word backward-word; do
forward-word backward-word transpose-words; do
autoload bash-$widget
zle -N $widget bash-$widget
done)

View file

@ -0,0 +1,9 @@
# This implements a bash-style transpose-words.
# To use,
# zle -N bash-transpose-words
# bindkey '...' bash-transpose-words
# or if you wish to replace existing transpose-words bindings,
# zle -N transpose-words bash-transpose-words
local WORDCHARS=''
zle .transpose-words