6

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.

Amanda
  • 272
  • 3
  • 13

2 Answers2

4

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

Readline's user documentation covers keyboard shortcuts.

Doug Harris
  • 27,333
  • 17
  • 78
  • 105
3

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]: 
esmit
  • 141
  • 3