source: trunk/share/ipythonrc-asap@ 691

Last change on this file since 691 was 688, checked in by mar637, 19 years ago

IPython config file to set up ASAP look-and-feel.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 14.3 KB
Line 
1# -*- Mode: Shell-Script -*- Not really, but shows comments correctly
2#***************************************************************************
3#
4# Configuration file for ipython -- ipythonrc format
5#
6# The format of this file is one of 'key value' lines.
7# Lines containing only whitespace at the beginning and then a # are ignored
8# as comments. But comments can NOT be put on lines with data.
9#***************************************************************************
10
11autocall 1
12
13autoindent 1
14
15automagic 1
16
17# Size of the output cache. After this many entries are stored, the cache will
18# get flushed. Depending on the size of your intermediate calculations, you
19# may have memory problems if you make it too big, since keeping things in the
20# cache prevents Python from reclaiming the memory for old results. Experiment
21# with a value that works well for you.
22
23# If you choose cache_size 0 IPython will revert to python's regular >>>
24# unnumbered prompt. You will still have _, __ and ___ for your last three
25# results, but that will be it. No dynamic _1, _2, etc. will be created. If
26# you are running on a slow machine or with very limited memory, this may
27# help.
28
29cache_size 100
30
31# Currently available schemes: NoColor, Linux, LightBG.
32
33# keep uncommented only the one you want:
34colors Linux
35#colors LightBG
36#colors NoColor
37
38# color_info: IPython can display information about objects via a set of
39# functions, and optionally can use colors for this, syntax highlighting
40# source code and various other elements. This information is passed through a
41# pager (it defaults to 'less' if $PAGER is not set).
42
43# If your pager has problems, try to setting it to properly handle escapes
44# (see the less manpage for detail), or disable this option. The magic
45# function @color_info allows you to toggle this interactively for testing.
46
47color_info 1
48
49# confirm_exit: set to 1 if you want IPython to confirm when you try to exit
50# with an EOF (Control-d in Unix, Control-Z/Enter in Windows). Note that using
51# the magic functions @Exit or @Quit you can force a direct exit, bypassing
52# any confirmation.
53
54confirm_exit 1
55
56# Use deep_reload() as a substitute for reload() by default. deep_reload() is
57# still available as dreload() and appears as a builtin.
58
59deep_reload 0
60
61# Which editor to use with the @edit command. If you leave this at 0, IPython
62# will honor your EDITOR environment variable. Since this editor is invoked on
63# the fly by ipython and is meant for editing small code snippets, you may
64# want to use a small, lightweight editor here.
65
66# For Emacs users, setting up your Emacs server properly as described in the
67# manual is a good idea. An alternative is to use jed, a very light editor
68# with much of the feel of Emacs (though not as powerful for heavy-duty work).
69
70editor 0
71
72# log 1 -> same as ipython -log. This automatically logs to ./ipython.log
73log 0
74
75# Same as ipython -Logfile YourLogfileName.
76# Don't use with log 1 (use one or the other)
77logfile ''
78
79# banner 0 -> same as ipython -nobanner
80banner 0
81
82# messages 0 -> same as ipython -nomessages
83messages 0
84
85# Automatically call the pdb debugger after every uncaught exception. If you
86# are used to debugging using pdb, this puts you automatically inside of it
87# after any call (either in IPython or in code called by it) which triggers an
88# exception which goes uncaught.
89pdb 0
90
91# Enable the pprint module for printing. pprint tends to give a more readable
92# display (than print) for complex nested data structures.
93pprint 1
94
95# Prompt strings (see ipython --help for more details).
96# Use %n to represent the current prompt number, and quote them to protect
97# spaces.
98prompt_in1 'ASAP>'
99
100# In prompt_in2, %n is replaced by as many dots as there are digits in the
101# current value of %n.
102prompt_in2 ' .%n.:'
103
104prompt_out 'asap>:'
105
106# quick 1 -> same as ipython -quick
107quick 0
108
109# Use the readline library (1) or not (0). Most users will want this on, but
110# if you experience strange problems with line management (mainly when using
111# IPython inside Emacs buffers) you may try disabling it. Not having it on
112# prevents you from getting command history with the arrow keys, searching and
113# name completion using TAB.
114
115readline 1
116
117# Screen Length: number of lines of your screen. This is used to control
118# printing of very long strings. Strings longer than this number of lines will
119# be paged with the less command instead of directly printed.
120
121# The default value for this is 0, which means IPython will auto-detect your
122# screen size every time it needs to print. If for some reason this isn't
123# working well (it needs curses support), specify it yourself. Otherwise don't
124# change the default.
125
126screen_length 0
127
128# Prompt separators for input and output.
129# Use \n for newline explicitly, without quotes.
130# Use 0 (like at the cmd line) to turn off a given separator.
131
132# The structure of prompt printing is:
133# (SeparateIn)Input....
134# (SeparateOut)Output...
135# (SeparateOut2), # that is, no newline is printed after Out2
136# By choosing these you can organize your output any way you want.
137
138separate_in \n
139
140separate_out 0
141
142separate_out2 0
143
144# 'nosep 1' is a shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'.
145# Simply removes all input/output separators, overriding the choices above.
146nosep 0
147
148# xmode - Exception reporting mode.
149
150# Valid modes: Plain, Context and Verbose.
151
152# Plain: similar to python's normal traceback printing.
153
154# Context: prints 5 lines of context source code around each line in the
155# traceback.
156
157# Verbose: similar to Context, but additionally prints the variables currently
158# visible where the exception happened (shortening their strings if too
159# long). This can potentially be very slow, if you happen to have a huge data
160# structure whose string representation is complex to compute. Your computer
161# may appear to freeze for a while with cpu usage at 100%. If this occurs, you
162# can cancel the traceback with Ctrl-C (maybe hitting it more than once).
163
164xmode Plain
165#xmode Context
166#xmode Verbose
167
168#---------------------------------------------------------------------------
169# Section: Readline configuration (readline is not available for MS-Windows)
170
171# This is done via the following options:
172
173# (i) readline_parse_and_bind: this option can appear as many times as you
174# want, each time defining a string to be executed via a
175# readline.parse_and_bind() command. The syntax for valid commands of this
176# kind can be found by reading the documentation for the GNU readline library,
177# as these commands are of the kind which readline accepts in its
178# configuration file.
179
180# The TAB key can be used to complete names at the command line in one of two
181# ways: 'complete' and 'menu-complete'. The difference is that 'complete' only
182# completes as much as possible while 'menu-complete' cycles through all
183# possible completions. Leave the one you prefer uncommented.
184
185readline_parse_and_bind tab: complete
186#readline_parse_and_bind tab: menu-complete
187
188# This binds Control-l to printing the list of all possible completions when
189# there is more than one (what 'complete' does when hitting TAB twice, or at
190# the first TAB if show-all-if-ambiguous is on)
191readline_parse_and_bind "\C-l": possible-completions
192
193# This forces readline to automatically print the above list when tab
194# completion is set to 'complete'. You can still get this list manually by
195# using the key bound to 'possible-completions' (Control-l by default) or by
196# hitting TAB twice. Turning this on makes the printing happen at the first
197# TAB.
198readline_parse_and_bind set show-all-if-ambiguous on
199
200# If you have TAB set to complete names, you can rebind any key (Control-o by
201# default) to insert a true TAB character.
202readline_parse_and_bind "\C-o": tab-insert
203
204# These commands allow you to indent/unindent easily, with the 4-space
205# convention of the Python coding standards. Since IPython's internal
206# auto-indent system also uses 4 spaces, you should not change the number of
207# spaces in the code below.
208readline_parse_and_bind "\M-i": " "
209readline_parse_and_bind "\M-o": "\d\d\d\d"
210readline_parse_and_bind "\M-I": "\d\d\d\d"
211
212# Bindings for incremental searches in the history. These searches use the
213# string typed so far on the command line and search anything in the previous
214# input history containing them.
215readline_parse_and_bind "\C-r": reverse-search-history
216readline_parse_and_bind "\C-s": forward-search-history
217
218# Bindings for completing the current line in the history of previous
219# commands. This allows you to recall any previous command by typing its first
220# few letters and hitting Control-p, bypassing all intermediate commands which
221# may be in the history (much faster than hitting up-arrow 50 times!)
222readline_parse_and_bind "\C-p": history-search-backward
223readline_parse_and_bind "\C-n": history-search-forward
224
225# (ii) readline_remove_delims: a string of characters to be removed from the
226# default word-delimiters list used by readline, so that completions may be
227# performed on strings which contain them.
228
229readline_remove_delims '"[]{}-/~
230
231#"' -- just to fix emacs coloring which gets confused by unmatched quotes.
232
233# (iii) readline_omit__names: normally hitting <tab> after a '.' in a name
234# will complete all attributes of an object, including all the special methods
235# whose names inlclude double underscores (like __getitem__ or __class__). If
236# you'd rather not see these names by default, you can set this option to 1.
237
238# Note that even when this option is set, you can still see those names by
239# explicitly typing a _ after the period and hitting <tab>: 'name._<tab>' will
240# always complete attribute names starting with '_'.
241
242# This option is off by default so that new users see all attributes of any
243# objects they are dealing with.
244
245readline_omit__names 0
246
247#---------------------------------------------------------------------------
248# Section: modules to be loaded with 'import ...'
249
250# List, separated by spaces, the names of the modules you want to import
251
252# Example:
253# import_mod sys os
254# will produce internally the statements
255# import sys
256# import os
257
258# Each import is executed in its own try/except block, so if one module
259# fails to load the others will still be ok.
260
261import_mod
262
263#---------------------------------------------------------------------------
264# Section: modules to import some functions from: 'from ... import ...'
265
266# List, one per line, the modules for which you want only to import some
267# functions. Give the module name first and then the name of functions to be
268# imported from that module.
269
270# Example:
271# import_some struct pack unpack
272# will produce internally the statement
273# from struct import pack,unpack
274
275# If you have more than one modules_some line, each gets its own try/except
276# block (like modules, see above).
277
278import_some
279
280#---------------------------------------------------------------------------
281# Section: modules to import all from : 'from ... import *'
282
283# List (same syntax as import_mod above) those modules for which you want to
284# import all functions. Remember, this is a potentially dangerous thing to do,
285# since it is very easy to overwrite names of things you need. Use with
286# caution.
287
288# Example:
289# import_all sys os
290# will produce internally the statements
291# from sys import *
292# from os import *
293
294# As before, each will be called in a separate try/except block.
295
296import_all asap
297
298#---------------------------------------------------------------------------
299# Section: Python code to execute.
300
301# Put here code to be explicitly executed (keep it simple!)
302# Put one line of python code per line. All whitespace is removed (this is a
303# feature, not a bug), so don't get fancy building loops here.
304# This is just for quick convenient creation of things you want available.
305
306# Example:
307# execute x = 1
308# execute print 'hello world'; y = z = 'a'
309# will produce internally
310# x = 1
311# print 'hello world'; y = z = 'a'
312# and each *line* (not each statement, we don't do python syntax parsing) is
313# executed in its own try/except block.
314
315execute
316
317# Note for the adventurous: you can use this to define your own names for the
318# magic functions, by playing some namespace tricks:
319
320# execute __IP.magic_cl = __IP.magic_clear
321
322# defines @cl as a new name for @clear.
323
324#---------------------------------------------------------------------------
325# Section: Pyhton files to load and execute.
326
327# Put here the full names of files you want executed with execfile(file). If
328# you want complicated initialization, just write whatever you want in a
329# regular python file and load it from here.
330
331# Filenames defined here (which *must* include the extension) are searched for
332# through all of sys.path. Since IPython adds your .ipython directory to
333# sys.path, they can also be placed in your .ipython dir and will be
334# found. Otherwise (if you want to execute things not in .ipyton nor in
335# sys.path) give a full path (you can use ~, it gets expanded)
336
337# Example:
338# execfile file1.py ~/file2.py
339# will generate
340# execfile('file1.py')
341# execfile('_path_to_your_home/file2.py')
342
343# As before, each file gets its own try/except block.
344
345execfile asapuserfuncs.py
346
347# If you are feeling adventurous, you can even add functionality to IPython
348# through here. IPython works through a global variable called __ip which
349# exists at the time when these files are read. If you know what you are doing
350# (read the source) you can add functions to __ip in files loaded here.
351
352# The file example-magic.py contains a simple but correct example. Try it:
353
354# execfile example-magic.py
355
356# Look at the examples in IPython/iplib.py for more details on how these magic
357# functions need to process their arguments.
358
359#---------------------------------------------------------------------------
360# Section: aliases for system shell commands
361
362# Here you can define your own names for system commands. The syntax is
363# similar to that of the builtin @alias function:
364
365# alias alias_name command_string
366
367# The resulting aliases are auto-generated magic functions (hence usable as
368# @alias_name)
369
370# For example:
371
372# alias myls ls -la
373
374# will define '@myls' as an alias for executing the system command 'ls -la'.
375# If automagic is on, you can just type myls like you would at a system shell
376# prompt. This allows you to customize IPython's environment to have the same
377# aliases you are accustomed to from your own shell.
378
379# You can also define aliases with parameters using %s specifiers (one per
380# parameter):
381
382# alias parts echo first %s second %s
383
384# will give you in IPython:
385# >>> @parts A B
386# first A second B
387
388# Use one 'alias' statement per alias you wish to define.
389
390#alias
Note: See TracBrowser for help on using the repository browser.