forked from VimPlug/jedi
repl documentation, adds @asmeurer suggestions
This commit is contained in:
+12
-2
@@ -1,8 +1,18 @@
|
|||||||
.. include:: ../global.rst
|
.. include:: ../global.rst
|
||||||
|
|
||||||
How to use Jedi from Python interpreter
|
Jedi autocompletion in the Python interpreter
|
||||||
=======================================
|
=============================================
|
||||||
|
|
||||||
|
There are two different options how you can use Jedi autocompletion in
|
||||||
|
your Python interpreter. One with your custom ``$HOME/.pythonrc.py`` file
|
||||||
|
and one that uses ``PYTHONSTARTUP``.
|
||||||
|
|
||||||
|
Using ``PYTHONSTARTUP``
|
||||||
|
-----------------------
|
||||||
|
|
||||||
.. automodule:: jedi.replstartup
|
.. automodule:: jedi.replstartup
|
||||||
|
|
||||||
|
Using a custom ``$HOME/.pythonrc.py``
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
.. autofunction:: jedi.utils.setup_readline
|
.. autofunction:: jedi.utils.setup_readline
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
"""
|
"""
|
||||||
``PYTHONSTARTUP`` to use Jedi in your Python interpreter.
|
|
||||||
|
|
||||||
To use Jedi completion in Python interpreter, add the following in your shell
|
To use Jedi completion in Python interpreter, add the following in your shell
|
||||||
setup (e.g., ``.bashrc``)::
|
setup (e.g., ``.bashrc``)::
|
||||||
|
|
||||||
|
|||||||
+7
-4
@@ -93,11 +93,14 @@ def setup_readline():
|
|||||||
Install Jedi completer to :mod:`readline`.
|
Install Jedi completer to :mod:`readline`.
|
||||||
|
|
||||||
This function setups :mod:`readline` to use Jedi in Python interactive
|
This function setups :mod:`readline` to use Jedi in Python interactive
|
||||||
shell. If you want to use custom ``PYTHONSTARTUP`` file, you can call
|
shell. If you want to use a custom ``PYTHONSTARTUP`` file (typically
|
||||||
this function like this:
|
``$HOME/.pythonrc.py``), you can add this piece of code:
|
||||||
|
|
||||||
>>> from jedi.utils import setup_readline
|
>>> try:
|
||||||
>>> setup_readline()
|
>>> from jedi.utils import setup_readline
|
||||||
|
>>> setup_readline()
|
||||||
|
>>> except ImportError:
|
||||||
|
>>> print('Install Jedi with pip! No autocompletion otherwise.')
|
||||||
|
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user