From 32f7b3206172ebc2ca59d609062f585502ac8619 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 20 Jul 2001 13:04:51 +0000 Subject: 15432: New bash-transpose-words widget --- ChangeLog | 5 +++++ Doc/Zsh/contrib.yo | 6 ++++-- Functions/Zle/bash-transpose-words | 9 +++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 Functions/Zle/bash-transpose-words diff --git a/ChangeLog b/ChangeLog index 9099f92c3..d89a90512 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-07-20 Peter Stephenson + + * 15432: Functions/Zle/bash-transpose-words, Doc/Zsh/contrib.yo: + new bash-branspose-words widget. + 2001-07-20 Sven Wischnowsky * 15433: Src/Zle/computil.c: don't use compsuffix when it might diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 9919117e5..86a8b79c6 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -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) diff --git a/Functions/Zle/bash-transpose-words b/Functions/Zle/bash-transpose-words new file mode 100644 index 000000000..eb96a1277 --- /dev/null +++ b/Functions/Zle/bash-transpose-words @@ -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 -- cgit 1.4.1