zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: interchange-line widget
Date: Sat, 14 May 2016 04:52:08 +0200	[thread overview]
Message-ID: <CAHYJk3S=gj58a9=pq0PeOhiJZp+hru=nRTKP-JLXpOZF0cQOKw@mail.gmail.com> (raw)

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


                 reply	other threads:[~2016-05-14  2:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3S=gj58a9=pq0PeOhiJZp+hru=nRTKP-JLXpOZF0cQOKw@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).