Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] enable number argument for transpose-words



On Fri, Aug 12, 2016 at 10:29:18AM +0100, Peter Stephenson wrote:
> On Fri, 12 Aug 2016 10:54:02 +0800
> Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx> wrote:
> > Any suggestions to this one, please? Thanks in advance.
> 
> Thanks, I've committed that.  This describes what it does.
> 
> pws
> 
> diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
> index eaca1b3..aa219dc 100644
> --- a/Doc/Zsh/zle.yo
> +++ b/Doc/Zsh/zle.yo
> @@ -1948,6 +1948,12 @@ to the left.
>  tindex(transpose-words)
>  item(tt(transpose-words) (tt(ESC-T ESC-t)) (unbound) (unbound))(
>  Exchange the current word with the one before it.
> +
> +With a positive numeric argument em(N), the word before the cursor is
> +transposed with the following em(N) words.
> +
> +With a negative numeric argument em(-N), the word after the cursor
> +is transposed with the preceding em(N) words.
>  )
>  tindex(vi-unindent)
>  item(tt(vi-unindent) (unbound) (tt(<)) (unbound))(
Thanks. But both positive and negative numeric argument would transpose
current word with preceding N/-N word. The negative argument only make
cursor doesn't change its position after the transpostion.



Messages sorted by: Reverse Date, Date, Thread, Author