Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When punching away at the keyboard on the octave command line, I sometimes find that the various readline shortcuts stop working, e.g. C-a and C-e just insert ^A and ^E.

It took me a while to realize that this is because I've accidentally switched to vi-editing-mode, and indeed there's is a toggle-editing-mode (C-M-j) documented in an old version of the octave manual.

My question is, how do I return to emacs-mode? I can't find any shortcut listed anywhere.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

After much web-searching and manipulation of ~/.inputrc, I accidentally found that C-e in vi-command mode actually does the trick and executes emacs-editing-mode. This is discussed in this posting, but with regards to bash, they must be related somehow, but I can't find how by looking in the octave sources.

Knowing what to look for also allowed me to find, one way to change this binding through ~/.inputrc:

$if mode=emacs
  set keymap vi

  "\e\C-j":   emacs-editing-mode
  "\C-x\C-r": re-read-init-file

  set keymap emacs
$endif

Anyway, seems I should be reading readline.info and perhaps also history.info.

Edit

Added C-M-j as a vi binding to switch back to emacs, in addition to the default C-e. Also added a vi-binding to re-read ~/.inputrc.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.