Skip to content

Commit 36fd81d

Browse files
committed
Update docs on .inputrc and input mode.
Bump ipython#9388 to 6.0
1 parent 05280f2 commit 36fd81d

1 file changed

Lines changed: 12 additions & 55 deletions

File tree

‎docs/source/interactive/reference.rst‎

Lines changed: 12 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -254,61 +254,18 @@ time you restart it. By default, the history file is named
254254
Autoindent
255255
++++++++++
256256

257-
IPython can recognize lines ending in ':' and indent the next line,
258-
while also un-indenting automatically after 'raise' or 'return'.
259-
260-
This feature uses the readline library, so it will honor your
261-
:file:`~/.inputrc` configuration (or whatever file your :envvar:`INPUTRC` environment variable points
262-
to). Adding the following lines to your :file:`.inputrc` file can make
263-
indenting/unindenting more convenient (M-i indents, M-u unindents)::
264-
265-
# if you don't already have a ~/.inputrc file, you need this include:
266-
$include /etc/inputrc
267-
268-
$if Python
269-
"\M-i": " "
270-
"\M-u": "\d\d\d\d"
271-
$endif
272-
273-
Note that there are 4 spaces between the quote marks after "M-i" above.
274-
275-
.. warning::
276-
277-
Setting the above indents will cause problems with unicode text entry in
278-
the terminal.
279-
280-
.. warning::
281-
282-
Autoindent is ON by default, but it can cause problems with the pasting of
283-
multi-line indented code (the pasted code gets re-indented on each line). A
284-
magic function %autoindent allows you to toggle it on/off at runtime. You
285-
can also disable it permanently on in your :file:`ipython_config.py` file
286-
(set TerminalInteractiveShell.autoindent=False).
287-
288-
If you want to paste multiple lines in the terminal, it is recommended that
289-
you use ``%paste``.
290-
291-
292-
Customizing readline behavior
293-
+++++++++++++++++++++++++++++
294-
295-
All these features are based on the GNU readline library, which has an
296-
extremely customizable interface. Normally, readline is configured via a
297-
:file:`.inputrc` file. IPython respects this, and you can also customise readline
298-
by setting the following :doc:`configuration </config/intro>` options:
299-
300-
* ``InteractiveShell.readline_parse_and_bind``: this holds a list of strings to be executed
301-
via a readline.parse_and_bind() command. The syntax for valid commands
302-
of this kind can be found by reading the documentation for the GNU
303-
readline library, as these commands are of the kind which readline
304-
accepts in its configuration file.
305-
* ``InteractiveShell.readline_remove_delims``: a string of characters to be removed
306-
from the default word-delimiters list used by readline, so that
307-
completions may be performed on strings which contain them. Do not
308-
change the default value unless you know what you're doing.
309-
310-
You will find the default values in your configuration file.
311-
257+
Starting with 5.0, IPython user `prompt_toolkit` in place of ``readline``,
258+
it thus can recognize lines ending in ':' and indent the next line,
259+
while also un-indenting automatically after 'raise' or 'return',
260+
and support real multi-line editing as well as syntactic coloration
261+
during edition.
262+
263+
This feature does not use the ``readline`` library anymore – at least for now
264+
– , so it will not honor your :file:`~/.inputrc` configuration (or whatever
265+
file your :envvar:`INPUTRC` environment variable points to).
266+
267+
In particular if you want to change the input mode to ``vi``, you will need to
268+
set the ``TerminalInteractiveShell.vi_mode`` configuration option of IPython.
312269

313270
Session logging and restoring
314271
-----------------------------

0 commit comments

Comments
 (0)