Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Rotate shell words widget
- X-seq: zsh-users 21549
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Rotate shell words widget
- Date: Wed, 11 May 2016 10:39:09 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=Go12zrEiMALV/7XMnxMyVdMFj3TgsYZuW1f2hyawMQ0=; b=Zj6SWTC0H4+bq7qTxK9gMg9KZoWxpDyK7IjsFsyZTSxqwRlWvxT22VV09psbDvalyN /sAHVx4scu6f/5oC7I1BAN3ujA20/eH2Z+O/K9+to1Rluq259z+tOyBUA/NBB3uMMddK 6eqS1BJ2BF0DruZfCIDwKYi6uPebM1l1jZwJODlL5vPxsf0r8HV9Y30GkLQZDAlPQXNi ccohdFkEiEjfFJ6CvOOJD38MZzdZAfdzC+KemLn66QFlWuGZMOlS7xxiYRDyvrsnf8kf oOSWfSgKeBl5PO/Nn/6MFIxRn31tHdXlUQz4z3hDcl/+D8eFYzyY5jf6WC3X9DqEOdIr XUoA==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hello,
I'm sharing my widget that rotates shell words. Thus:
$(( 1 )) $( 2 ) 3
becomes
3 $(( 1 )) $( 2 )
https://asciinema.org/a/7igqc3pmyhunbqcxf09lqs1ju
To use copy the two attached files to *functions directory and add to zshrc:
# Alt-r to rotate shell words right, Alt-R - left
autoload zew-rotate-shell-words
zle -N zew-rotate-shell-words
zle -N zew-rotate-shell-words-backwards zew-rotate-shell-words
bindkey '^[r' zew-rotate-shell-words
bindkey '^[R' zew-rotate-shell-words-backwards
The widget is part of Zsh Editing Workbench plugin:
https://github.com/psprint/zsh-editing-workbench
Best regards,
Sebastian Gniazdowski
Attachment:
zew-rotate-shell-words
Description: Binary data
Attachment:
zew-process-buffer
Description: Binary data
Messages sorted by:
Reverse Date,
Date,
Thread,
Author