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.

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.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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

Readline's user documentation covers keyboard shortcuts.

share|improve this answer

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]: 
share|improve this answer
    
Awesome. That's even easier than ctrl-a, ctrl-k –  Amanda Mar 8 '13 at 14:04

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.