Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
interchange-line widget
- X-seq: zsh-users 21562
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: interchange-line widget
- Date: Sat, 14 May 2016 04:52:08 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=kTOMG8YNi7axmKonqiZT09mUPZd/0N8GIuhdGhpMOAc=; b=rKbzpA9OgXh07WvsMh6F0uJ9A0l2D5z8bw5747XRtCgo3WQbh+AiF/90WjXjRRy+5f b3ulidOVro45QfhqNwWPTF80WYvMidFWTaLN0Y8fabxfAiuiYXXs9AuA+CTtVYKAfYUV vgJm99X9BYqoi2Er9HFLelZpPxju0F57tcn4HZvaGyIPmx6FVhKovsJB/FzCkR68I8O+ ExIUmoQ+So7MxGqibQZqYT0ImCfrHIabo1FnnzsmVLE1Bll0a4KRO77Mnvth8xxPPkyt mmQbZegZsl9ACxLpx32t3iVuXQMnKK6zrcRuICZyVdtr1fbZ6nb62i23Xh0jXLK5pTuy XO7Q==
- 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
If you start typing something, and change your mind, you can already
use the push-input widget. However, if you change your mind while
typing the new command and want to go back to your first command, your
options are more limited. With this widget, you can change your mind
as many times as you want! Hooray!
function _interchange_line() {
local REPLY
read -z
print -rz - $BUFFER
BUFFER=$REPLY
CURSOR=$#BUFFER
}
zle -N interchange-line _interchange_line
bindkey your-favorite-key interchange-line
I personally use F11 for push-input, alt-F11 for get-line, and
ctrl-F11 for the above widget. push-line (not push-input) is bound to
alt-q by default in emacs mode, and get-line to alt-g.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author