Remove trailing whitespace
[grml-etc.git] / etc / skel / .ipython / ipythonrc
1 # Filename:      i$HOME/.ipython/ipythonrc
2 # Purpose:       configuration file for ipython
3 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
4 # Bug-Reports:   see http://grml.org/bugs/
5 # License:       This file is licensed under the GPL v2.
6 ################################################################################
7
8 #***************************************************************************
9 #
10 # Configuration file for IPython -- ipythonrc format
11 #
12 # ===========================================================
13 # Deprecation note: you should look into modifying ipy_user_conf.py (located 
14 # in ~/.ipython or ~/_ipython, depending on your platform) instead, it's a 
15 # more flexible and robust (and better supported!) configuration
16 # method.
17 # ===========================================================
18 #
19 # The format of this file is simply one of 'key value' lines.
20 # Lines containing only whitespace at the beginning and then a # are ignored
21 # as comments. But comments can NOT be put on lines with data.
22
23 # The meaning and use of each key are explained below.
24
25 #---------------------------------------------------------------------------
26 # Section: included files
27
28 # Put one or more *config* files (with the syntax of this file) you want to
29 # include. For keys with a unique value the outermost file has precedence. For
30 # keys with multiple values, they all get assembled into a list which then
31 # gets loaded by IPython.
32
33 # In this file, all lists of things should simply be space-separated.
34
35 # This allows you to build hierarchies of files which recursively load
36 # lower-level services. If this is your main ~/.ipython/ipythonrc file, you
37 # should only keep here basic things you always want available. Then you can
38 # include it in every other special-purpose config file you create.
39 include 
40
41 #---------------------------------------------------------------------------
42 # Section: startup setup
43
44 # These are mostly things which parallel a command line option of the same
45 # name.
46
47 # Keys in this section should only appear once. If any key from this section
48 # is encountered more than once, the last value remains, all earlier ones get
49 # discarded.
50
51 # Automatic calling of callable objects.  If set to 1 or 2, callable objects
52 # are automatically called when invoked at the command line, even if you don't
53 # type parentheses.  IPython adds the parentheses for you.  For example:
54
55 #In [1]: str 45
56 #------> str(45)
57 #Out[1]: '45'
58
59 # IPython reprints your line with '---->' indicating that it added
60 # parentheses.  While this option is very convenient for interactive use, it
61 # may occasionally cause problems with objects which have side-effects if
62 # called unexpectedly.
63
64 # The valid values for autocall are:
65
66 # autocall 0 -> disabled (you can toggle it at runtime with the %autocall magic)
67
68 # autocall 1 -> active, but do not apply if there are no arguments on the line.
69
70 # In this mode, you get:
71
72 #In [1]: callable
73 #Out[1]: <built-in function callable>
74
75 #In [2]: callable 'hello'
76 #------> callable('hello')
77 #Out[2]: False
78
79 # 2 -> Active always.  Even if no arguments are present, the callable object
80 # is called:
81
82 #In [4]: callable
83 #------> callable()
84
85 # Note that even with autocall off, you can still use '/' at the start of a
86 # line to treat the first argument on the command line as a function and add
87 # parentheses to it:
88
89 #In [8]: /str 43
90 #------> str(43)
91 #Out[8]: '43'
92
93 autocall 1
94
95 # Auto-edit syntax errors.  When you use the %edit magic in ipython to edit
96 # source code (see the 'editor' variable below), it is possible that you save
97 # a file with syntax errors in it.  If this variable is true, IPython will ask
98 # you whether to re-open the editor immediately to correct such an error.
99
100 autoedit_syntax 0
101
102 # Auto-indent. IPython can recognize lines ending in ':' and indent the next
103 # line, while also un-indenting automatically after 'raise' or 'return'.  
104
105 # This feature uses the readline library, so it will honor your ~/.inputrc
106 # configuration (or whatever file your INPUTRC variable points to).  Adding
107 # the following lines to your .inputrc file can make indent/unindenting more
108 # convenient (M-i indents, M-u unindents):
109
110 #  $if Python
111 #  "\M-i": "    "
112 #  "\M-u": "\d\d\d\d"
113 #  $endif
114
115 # The feature is potentially a bit dangerous, because it can cause problems
116 # with pasting of indented code (the pasted code gets re-indented on each
117 # line).  But it's a huge time-saver when working interactively.  The magic
118 # function %autoindent allows you to toggle it on/off at runtime.
119
120 autoindent 1
121
122 # Auto-magic. This gives you access to all the magic functions without having
123 # to prepend them with an % sign. If you define a variable with the same name
124 # as a magic function (say who=1), you will need to access the magic function
125 # with % (%who in this example). However, if later you delete your variable
126 # (del who), you'll recover the automagic calling form.
127
128 # Considering that many magic functions provide a lot of shell-like
129 # functionality, automagic gives you something close to a full Python+system
130 # shell environment (and you can extend it further if you want).
131
132 automagic 1
133
134 # Size of the output cache. After this many entries are stored, the cache will
135 # get flushed. Depending on the size of your intermediate calculations, you
136 # may have memory problems if you make it too big, since keeping things in the
137 # cache prevents Python from reclaiming the memory for old results. Experiment
138 # with a value that works well for you.
139
140 # If you choose cache_size 0 IPython will revert to python's regular >>>
141 # unnumbered prompt. You will still have _, __ and ___ for your last three
142 # results, but that will be it.  No dynamic _1, _2, etc. will be created. If
143 # you are running on a slow machine or with very limited memory, this may
144 # help.
145
146 cache_size 1000
147
148 # Classic mode: Setting 'classic 1' you lose many of IPython niceties,
149 # but that's your choice! Classic 1 -> same as IPython -classic.
150 # Note that this is _not_ the normal python interpreter, it's simply
151 # IPython emulating most of the classic interpreter's behavior.
152 classic 0
153
154 # colors - Coloring option for prompts and traceback printouts.
155
156 # Currently available schemes: NoColor, Linux, LightBG.
157
158 # This option allows coloring the prompts and traceback printouts. This
159 # requires a terminal which can properly handle color escape sequences. If you
160 # are having problems with this, use the NoColor scheme (uses no color escapes
161 # at all).
162
163 # The Linux option works well in linux console type environments: dark
164 # background with light fonts.
165
166 # LightBG is similar to Linux but swaps dark/light colors to be more readable
167 # in light background terminals.
168
169 # keep uncommented only the one you want:
170 colors Linux
171 #colors LightBG
172 #colors NoColor
173
174 ########################
175 # Note to Windows users
176 #
177 # Color and readline support is avaialble to Windows users via Gary Bishop's
178 # readline library.  You can find Gary's tools at
179 # http://sourceforge.net/projects/uncpythontools.
180 # Note that his readline module requires in turn the ctypes library, available
181 # at http://starship.python.net/crew/theller/ctypes.
182 ########################
183
184 # color_info: IPython can display information about objects via a set of
185 # functions, and optionally can use colors for this, syntax highlighting
186 # source code and various other elements. This information is passed through a
187 # pager (it defaults to 'less' if $PAGER is not set). 
188
189 # If your pager has problems, try to setting it to properly handle escapes
190 # (see the less manpage for detail), or disable this option.  The magic
191 # function %color_info allows you to toggle this interactively for testing.
192
193 color_info 1
194
195 # confirm_exit: set to 1 if you want IPython to confirm when you try to exit
196 # with an EOF (Control-d in Unix, Control-Z/Enter in Windows). Note that using
197 # the magic functions %Exit or %Quit you can force a direct exit, bypassing
198 # any confirmation.
199
200 confirm_exit 1
201
202 # Use deep_reload() as a substitute for reload() by default. deep_reload() is
203 # still available as dreload() and appears as a builtin.
204
205 deep_reload 0
206
207 # Which editor to use with the %edit command. If you leave this at 0, IPython
208 # will honor your EDITOR environment variable. Since this editor is invoked on
209 # the fly by ipython and is meant for editing small code snippets, you may
210 # want to use a small, lightweight editor here.
211
212 # For Emacs users, setting up your Emacs server properly as described in the
213 # manual is a good idea. An alternative is to use jed, a very light editor
214 # with much of the feel of Emacs (though not as powerful for heavy-duty work).
215
216 editor 0
217
218 # log 1 -> same as ipython -log. This automatically logs to ./ipython.log
219 log 0
220
221 # Same as ipython -Logfile YourLogfileName. 
222 # Don't use with log 1 (use one or the other)
223 logfile '~/.ipython/ipython.log'
224
225 # banner 0 -> same as ipython -nobanner
226 banner 1
227
228 # messages 0 -> same as ipython -nomessages
229 messages 1
230
231 # Automatically call the pdb debugger after every uncaught exception. If you
232 # are used to debugging using pdb, this puts you automatically inside of it
233 # after any call (either in IPython or in code called by it) which triggers an
234 # exception which goes uncaught.
235 pdb 0
236
237 # Enable the pprint module for printing. pprint tends to give a more readable
238 # display (than print) for complex nested data structures.
239 pprint 1
240
241 # Prompt strings
242
243 # Most bash-like escapes can be used to customize IPython's prompts, as well as
244 # a few additional ones which are IPython-specific.  All valid prompt escapes
245 # are described in detail in the Customization section of the IPython HTML/PDF
246 # manual.
247
248 # Use \# to represent the current prompt number, and quote them to protect
249 # spaces.
250 prompt_in1 'In [\#]: '
251
252 # \D is replaced by as many dots as there are digits in the
253 # current value of \#.
254 prompt_in2 '   .\D.: '
255
256 prompt_out 'Out[\#]: '
257
258 #prompt_in1 '[ip] \C_LightBlue\u@\C_White\h \Y1 \# \C_White% '
259 #prompt_in2 '\C_Green|\C_LightGreen\D\C_Green> '
260 #prompt_out '<\#> '
261
262 # Select whether to left-pad the output prompts to match the length of the
263 # input ones.  This allows you for example to use a simple '>' as an output
264 # prompt, and yet have the output line up with the input.  If set to false,
265 # the output prompts will be unpadded (flush left).
266 prompts_pad_left 1
267
268 # Pylab support: when ipython is started with the -pylab switch, by default it
269 # executes 'from matplotlib.pylab import *'.  Set this variable to false if you
270 # want to disable this behavior.
271
272 # For details on pylab, see the matplotlib website:
273 # http://matplotlib.sf.net
274 pylab_import_all 1
275
276 # quick 1 -> same as ipython -quick
277 quick 0
278
279 # Use the readline library (1) or not (0). Most users will want this on, but
280 # if you experience strange problems with line management (mainly when using
281 # IPython inside Emacs buffers) you may try disabling it. Not having it on
282 # prevents you from getting command history with the arrow keys, searching and
283 # name completion using TAB.
284
285 readline 1
286
287 # Screen Length: number of lines of your screen. This is used to control
288 # printing of very long strings. Strings longer than this number of lines will
289 # be paged with the less command instead of directly printed.
290
291 # The default value for this is 0, which means IPython will auto-detect your
292 # screen size every time it needs to print. If for some reason this isn't
293 # working well (it needs curses support), specify it yourself. Otherwise don't
294 # change the default.
295
296 screen_length 0
297
298 # Prompt separators for input and output.
299 # Use \n for newline explicitly, without quotes.
300 # Use 0 (like at the cmd line) to turn off a given separator.
301
302 # The structure of prompt printing is:
303 # (SeparateIn)Input....
304 # (SeparateOut)Output...
305 # (SeparateOut2),   # that is, no newline is printed after Out2
306 # By choosing these you can organize your output any way you want.
307
308 #separate_in \n
309 # Do *not* separate prompt lines, instead use default [z]sh behaviour:
310 separate_in 0
311 separate_out 0
312 separate_out2 0
313
314 # 'nosep 1' is a shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'.
315 # Simply removes all input/output separators, overriding the choices above.
316 nosep 0
317
318 # Wildcard searches - IPython has a system for searching names using
319 # shell-like wildcards; type %psearch? for details.  This variables sets
320 # whether by default such searches should be case sensitive or not.  You can
321 # always override the default at the system command line or the IPython
322 # prompt.
323
324 wildcards_case_sensitive 1
325
326 # Object information: at what level of detail to display the string form of an
327 # object.  If set to 0, ipython will compute the string form of any object X,
328 # by calling str(X), when X? is typed.  If set to 1, str(X) will only be
329 # computed when X?? is given, and if set to 2 or higher, it will never be
330 # computed (there is no X??? level of detail).  This is mostly of use to
331 # people who frequently manipulate objects whose string representation is
332 # extremely expensive to compute.
333
334 object_info_string_level 0
335
336 # xmode - Exception reporting mode. 
337
338 # Valid modes: Plain, Context and Verbose.
339
340 # Plain: similar to python's normal traceback printing.
341
342 # Context: prints 5 lines of context source code around each line in the
343 # traceback.
344
345 # Verbose: similar to Context, but additionally prints the variables currently
346 # visible where the exception happened (shortening their strings if too
347 # long). This can potentially be very slow, if you happen to have a huge data
348 # structure whose string representation is complex to compute. Your computer
349 # may appear to freeze for a while with cpu usage at 100%. If this occurs, you
350 # can cancel the traceback with Ctrl-C (maybe hitting it more than once).
351
352 #xmode Plain
353 xmode Context
354 #xmode Verbose
355
356 # multi_line_specials: if true, allow magics, aliases and shell escapes (via
357 # !cmd) to be used in multi-line input (like for loops).  For example, if you
358 # have this active, the following is valid in IPython:
359 #
360 #In [17]: for i in range(3):
361 #   ....:     mkdir $i
362 #   ....:     !touch $i/hello
363 #   ....:     ls -l $i
364
365 multi_line_specials 1
366
367 # System calls: When IPython makes system calls (e.g. via special syntax like
368 # !cmd or !!cmd, or magics like %sc or %sx), it can print the command it is
369 # executing to standard output, prefixed by a header string.
370
371 system_header "IPython system call: "
372
373 system_verbose 1
374
375 # wxversion: request a specific wxPython version (used for -wthread)
376
377 # Set this to the value of wxPython you want to use, but note that this
378 # feature requires you to have the wxversion Python module to work.  If you
379 # don't have the wxversion module (try 'import wxversion' at the prompt to
380 # check) or simply want to leave the system to pick up the default, leave this
381 # variable at 0.
382
383 wxversion 0
384
385 #---------------------------------------------------------------------------
386 # Section: Readline configuration (readline is not available for MS-Windows)
387
388 # This is done via the following options:
389
390 # (i) readline_parse_and_bind: this option can appear as many times as you
391 # want, each time defining a string to be executed via a
392 # readline.parse_and_bind() command. The syntax for valid commands of this
393 # kind can be found by reading the documentation for the GNU readline library,
394 # as these commands are of the kind which readline accepts in its
395 # configuration file.
396
397 # The TAB key can be used to complete names at the command line in one of two
398 # ways: 'complete' and 'menu-complete'. The difference is that 'complete' only
399 # completes as much as possible while 'menu-complete' cycles through all
400 # possible completions. Leave the one you prefer uncommented.
401
402 readline_parse_and_bind tab: complete
403 #readline_parse_and_bind tab: menu-complete
404
405 # This binds Control-l to printing the list of all possible completions when
406 # there is more than one (what 'complete' does when hitting TAB twice, or at
407 # the first TAB if show-all-if-ambiguous is on)
408 readline_parse_and_bind "\C-l": possible-completions
409 # readline_parse_and_bind "\C-l": clear-screen
410
411 # This forces readline to automatically print the above list when tab
412 # completion is set to 'complete'. You can still get this list manually by
413 # using the key bound to 'possible-completions' (Control-l by default) or by
414 # hitting TAB twice. Turning this on makes the printing happen at the first
415 # TAB.
416 readline_parse_and_bind set show-all-if-ambiguous on
417
418 # If you have TAB set to complete names, you can rebind any key (Control-o by
419 # default) to insert a true TAB character.
420 readline_parse_and_bind "\C-o": tab-insert
421
422 # These commands allow you to indent/unindent easily, with the 4-space
423 # convention of the Python coding standards.  Since IPython's internal
424 # auto-indent system also uses 4 spaces, you should not change the number of
425 # spaces in the code below.
426 readline_parse_and_bind "\M-i": "    "
427 readline_parse_and_bind "\M-o": "\d\d\d\d"
428 readline_parse_and_bind "\M-I": "\d\d\d\d"
429
430 # Bindings for incremental searches in the history. These searches use the
431 # string typed so far on the command line and search anything in the previous
432 # input history containing them.
433 readline_parse_and_bind "\C-r": reverse-search-history
434 readline_parse_and_bind "\C-s": forward-search-history
435
436 # Bindings for completing the current line in the history of previous
437 # commands. This allows you to recall any previous command by typing its first
438 # few letters and hitting Control-p, bypassing all intermediate commands which
439 # may be in the history (much faster than hitting up-arrow 50 times!)
440 readline_parse_and_bind "\C-p": history-search-backward
441 readline_parse_and_bind "\C-n": history-search-forward
442
443 # I also like to have the same functionality on the plain arrow keys. If you'd
444 # rather have the arrows use all the history (and not just match what you've
445 # typed so far), comment out or delete the next two lines.
446 readline_parse_and_bind "\e[A": history-search-backward
447 readline_parse_and_bind "\e[B": history-search-forward
448
449 # These are typically on by default under *nix, but not win32.
450 readline_parse_and_bind "\C-k": kill-line
451 readline_parse_and_bind "\C-u": unix-line-discard
452
453 # (ii) readline_remove_delims: a string of characters to be removed from the
454 # default word-delimiters list used by readline, so that completions may be
455 # performed on strings which contain them.
456
457 readline_remove_delims -/~
458
459 # (iii) readline_merge_completions: whether to merge the result of all
460 # possible completions or not.  If true, IPython will complete filenames,
461 # python names and aliases and return all possible completions.  If you set it
462 # to false, each completer is used at a time, and only if it doesn't return
463 # any completions is the next one used.
464
465 # The default order is: [python_matches, file_matches, alias_matches]
466
467 readline_merge_completions 1
468
469 # (iv) readline_omit__names: normally hitting <tab> after a '.' in a name
470 # will complete all attributes of an object, including all the special methods
471 # whose names start with single or double underscores (like __getitem__ or
472 # __class__).
473
474 # This variable allows you to control this completion behavior:
475
476 # readline_omit__names 1 -> completion will omit showing any names starting
477 # with two __, but it will still show names starting with one _.
478
479 # readline_omit__names 2 -> completion will omit all names beginning with one
480 # _ (which obviously means filtering out the double __ ones).
481
482 # Even when this option is set, you can still see those names by explicitly
483 # typing a _ after the period and hitting <tab>: 'name._<tab>' will always
484 # complete attribute names starting with '_'.
485
486 # This option is off by default so that new users see all attributes of any
487 # objects they are dealing with.
488
489 readline_omit__names 0
490
491 #---------------------------------------------------------------------------
492 # Section: modules to be loaded with 'import ...'
493
494 # List, separated by spaces, the names of the modules you want to import
495
496 # Example:
497 # import_mod sys os
498 # will produce internally the statements
499 # import sys
500 # import os
501
502 # Each import is executed in its own try/except block, so if one module
503 # fails to load the others will still be ok.
504
505 import_mod 
506
507 # Load all the actual syntax extensions for shell-like operation, which live
508 # in the InterpreterExec standard extension.
509 # Warning: constructs like '[ x*3 for x in [1,2,3]]' might not work when
510 # activating this module - see http://bts.grml.org/grml/issue618
511 # import_all IPython.Extensions.InterpreterExec
512
513 #---------------------------------------------------------------------------
514 # Section: modules to import some functions from: 'from ... import ...'
515
516 # List, one per line, the modules for which you want only to import some
517 # functions. Give the module name first and then the name of functions to be
518 # imported from that module.
519
520 # Example:
521
522 # import_some IPython.genutils timing timings
523 # will produce internally the statement
524 # from IPython.genutils import timing, timings
525
526 # timing() and timings() are two IPython utilities for timing the execution of
527 # your own functions, which you may find useful.  Just commment out the above
528 # line if you want to test them.
529
530 # If you have more than one modules_some line, each gets its own try/except
531 # block (like modules, see above).
532
533 import_some 
534
535 #---------------------------------------------------------------------------
536 # Section: modules to import all from : 'from ... import *'
537
538 # List (same syntax as import_mod above) those modules for which you want to
539 # import all functions. Remember, this is a potentially dangerous thing to do,
540 # since it is very easy to overwrite names of things you need. Use with
541 # caution.
542
543 # Example:
544 # import_all sys os
545 # will produce internally the statements
546 # from sys import *
547 # from os import *
548
549 # As before, each will be called in a separate try/except block.
550
551 import_all 
552
553 #---------------------------------------------------------------------------
554 # Section: Python code to execute.
555
556 # Put here code to be explicitly executed (keep it simple!)
557 # Put one line of python code per line. All whitespace is removed (this is a
558 # feature, not a bug), so don't get fancy building loops here.
559 # This is just for quick convenient creation of things you want available.
560
561 # Example:
562 # execute x = 1
563 # execute print 'hello world'; y = z = 'a'
564 # will produce internally
565 # x = 1
566 # print 'hello world'; y = z = 'a'
567 # and each *line* (not each statement, we don't do python syntax parsing) is
568 # executed in its own try/except block.
569
570 execute 
571
572 # Note for the adventurous: you can use this to define your own names for the
573 # magic functions, by playing some namespace tricks:
574
575 # execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
576
577 # defines %pf as a new name for %profile.
578
579 #---------------------------------------------------------------------------
580 # Section: Pyhton files to load and execute.
581
582 # Put here the full names of files you want executed with execfile(file).  If
583 # you want complicated initialization, just write whatever you want in a
584 # regular python file and load it from here.
585
586 # Filenames defined here (which *must* include the extension) are searched for
587 # through all of sys.path. Since IPython adds your .ipython directory to
588 # sys.path, they can also be placed in your .ipython dir and will be
589 # found. Otherwise (if you want to execute things not in .ipyton nor in
590 # sys.path) give a full path (you can use ~, it gets expanded)
591
592 # Example:
593 # execfile file1.py ~/file2.py
594 # will generate
595 # execfile('file1.py')
596 # execfile('_path_to_your_home/file2.py')
597
598 # As before, each file gets its own try/except block.
599
600 execfile
601
602 # If you are feeling adventurous, you can even add functionality to IPython
603 # through here. IPython works through a global variable called __ip which
604 # exists at the time when these files are read. If you know what you are doing
605 # (read the source) you can add functions to __ip in files loaded here. 
606
607 # The file example-magic.py contains a simple but correct example. Try it:
608
609 # execfile example-magic.py
610
611 # Look at the examples in IPython/iplib.py for more details on how these magic
612 # functions need to process their arguments.
613
614 #---------------------------------------------------------------------------
615 # Section: aliases for system shell commands
616
617 # Here you can define your own names for system commands. The syntax is
618 # similar to that of the builtin %alias function:
619
620 # alias alias_name command_string
621
622 # The resulting aliases are auto-generated magic functions (hence usable as
623 # %alias_name)
624
625 # For example:
626
627 # alias myls ls -la
628
629 # will define 'myls' as an alias for executing the system command 'ls -la'.
630 # This allows you to customize IPython's environment to have the same aliases
631 # you are accustomed to from your own shell.
632
633 # You can also define aliases with parameters using %s specifiers (one per
634 # parameter):
635
636 # alias parts echo first %s second %s
637
638 # will give you in IPython:
639 # >>> %parts A B
640 # first A second B
641
642 # Use one 'alias' statement per alias you wish to define.
643
644 # alias 
645
646 #************************* end of file <ipythonrc> ************************