zsh-users
 help / color / mirror / code / Atom feed
* interchange-line widget
@ 2016-05-14  2:52 Mikael Magnusson
  0 siblings, 0 replies; only message in thread
From: Mikael Magnusson @ 2016-05-14  2:52 UTC (permalink / raw)
  To: Zsh Users

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-14  2:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-14  2:52 interchange-line widget Mikael Magnusson

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).