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