From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17238 invoked by alias); 14 May 2016 02:52:13 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21562 Received: (qmail 20124 invoked from network); 14 May 2016 02:52:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=kTOMG8YNi7axmKonqiZT09mUPZd/0N8GIuhdGhpMOAc=; b=E7urMVxoWaqwEva2755DgKafh+N4sT9paZxcLIyuZAXCuG1vXLc79YlunENLdpl+XK ipde5+ZjvfmfVZ4E7A0BUivhRhIdcksUJz2RpKfDsrG1Sa0qukhGVPb55EcEUx06hy7h JhcH9eozaAnMzfqC86y6E0AQ+l0ovJjukD2v8YJVY0IoOlHeHWf7OkJyxSj8MDc1eLgP 1YjMCNSHXvWf6u/YI7hIYnRWVXtbL11h3klYF3vrVqpYwlOdGsu+NwZoM62aXRe/3W07 0v0r+MNmuOg7PFkfbxucaHu+Fy8aax97mf0eR8fbwvNn427U59g4NKJAY9HWsH8uLqaw Ao5Q== X-Gm-Message-State: AOPr4FVU4eKxvbt+lk0hOpZ0jIny97n4651dCVabCu+N/6z1fDXdbrev3qMj5r67UitJ0zHE9cn7H/nQlhCwgQ== MIME-Version: 1.0 X-Received: by 10.140.102.140 with SMTP id w12mr18723654qge.6.1463194328116; Fri, 13 May 2016 19:52:08 -0700 (PDT) Date: Sat, 14 May 2016 04:52:08 +0200 Message-ID: Subject: interchange-line widget From: Mikael Magnusson To: Zsh Users Content-Type: text/plain; charset=UTF-8 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