Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: New widget "transpose-segments"
- X-seq: zsh-workers 37525
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: New widget "transpose-segments"
- Date: Sat, 9 Jan 2016 18:59:36 +0100
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=l8FyN8fopoGLkRBGXUwTdf5dd2UZDD2XV3iPyjXLG+A=; b=FX6ShBXoV7gtNYPLJDn7NP0Ki7arwnVcK7h2ucnqAYCRQe2lXcLeGyiqhzTK+flNOH 4rXlhliTUoI2TVSFzUJNdvTJNN/8UoOG+Rk3WizRZH2EsoIr3pNmW606JXAv6SWMqw64 E4aJuELPDYZinrS0uEpU3HLuwiLfoyavgXrYNs79j5eR3LBNvnw1NIplzFh1fh2UUUWw Ei+Tu/a5gmHYkGkkjpE6oknxHstnwnZ6H6wymgo+Yze97B3+ntqum8pFYPZ0l1Yz1oAM amBIT9uNXptMA7YlAgZeqC1ulPrHfeLbUlHLr+4Ggo3GiKQ6BR5o+NcbG0yvxYDE/LiM Ue/g==
- In-reply-to: <160109092258.ZM3394@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCVFN2639GkbitXO_yZtqK02zUWH-oLGYBysv6J3TreTg@mail.gmail.com> <160109092258.ZM3394@torch.brasslantern.com>
On 9 January 2016 at 18:22, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Jan 9, 12:03pm, Sebastian Gniazdowski wrote:
> } Subject: New widget "transpose-segments"
> }
> } I've attached a new widget "transpose-segments". Works like
> } "transpose-words", but the "words" are what I call "segments"
>
> How does this differ from
>
> autoload select-word-style
> select-word-style shell
> zle -N transpose-words transpose-words-match
>
> ??
I now tested:
autoload select-word-style
select-word-style shell
autoload transpose-words-match
zle -N transpose-words-match
bindkey "^[t" transpose-words-match
The main difference is working across newlines. Also, the requirement
to position cursor at beginning of word to transpose is absent. I
think those two are important. Also, setting word style is not needed.
I have to admit that my functionality isn't new and practically exists
in Zsh already, however, why not have alternative approach available,
with freedom of where to position cursor and with support for
newlines. And with freedom for word style.
BTW. I asked about transpose-words on IRC and here, and then nobody
told me about set-word-style shell. That's maybe not bad if the
alternative (z)-based approach will be recognized as valuable.
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author