I'm mostly loving ipython, but exasperated by my efforts to find any documentation for keyboard shortcuts. I can arrow/scroll through my command history, I can use ctrl r to search my history, a la bash, but other bash/readline commands alt D to delete a word or ctrl k to delete a line don't work. I've seen plenty of questions that seem to be about keyboard shortcuts and key bindings, but not a lot of answers.

iPython in Terminal.app: multi-line editing

I'd settle for unindent help right now -- ipython does a nice job of indenting for you when you start a loop or function definition, but it seems like I must be missing something everytime I backspace backspace backspace backspace to unindent when I'm done with my loop.


iPython is built on GNU Readline - the same basis for command line editing in bash.

Readline's user documentation covers keyboard shortcuts.


You don't need to backspace, just push enter again when you want to end your block; the blank line will signal the end of the block and the extra space will be ignored.

In [17]: for i in range(2):
   ....:     for k in range(1):
   ....:         print i,k
   0 0
   1 0

In [18]: 
  • Awesome. That's even easier than ctrl-a, ctrl-k – Amanda Mar 8 '13 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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