Monday, August 28, 2017

Re: ksh ^R vs EDITOR=vi

> From andreas.kahari@nbis.se Mon Aug 28 09:27:40 2017
> Date: Mon, 28 Aug 2017 10:53:45 +0200
> From: Andreas Kusalananda =?iso-8859-1?B?S+Ro5HJp?= <andreas.kahari@nbis.se>
> To: Jan Stary <hans@stare.cz>
> Subject: Re: ksh ^R vs EDITOR=vi
>
> ^R is for searching backwards in the command line history in Emacs mode
> while Vi mode uses <ESC>/ (just like in the Vi editor).

^R was for reprint as you see in stty -a. Useful for remembering what
you've already typed when some background program clobbers your input.

I think it changed in 5.9 or 6.0. Bash has done the history search
thing as long as I can remember.

I often type EDITOR=vi svn commit since svn defaults to an error message
instead of some fallback editor. This has the unfortunate side effect
of breaking all the keybindings until I remember to type set -o emacs.

What works is to set EDITOR in your profile, then set -o emacs. The other
order will result in the shell changing to vi mode.

Or we could all set EDITOR to ed, the STANDARD text editor.

Martin

No comments:

Post a Comment