Links:
- Documentation (at GitHub Pages)
- Repository (at GitHub)
- Issue tracker (at GitHub)
- Travis CI
Jedi.el is a Python auto-completion package for Emacs. It aims at helping your Python coding in a non-destructive way. It also helps you to find information about Python objects, such as docstring, function arguments and code location.
Jedi.el uses jedi (an awesome Python auto-completion library) and EPC (an RPC stack for Emacs Lisp) and its Python binding to communicate with Python process. It also uses excellent Emacs auto-complete module to start completion automatically. As Jedi.el always calls Python function asynchronously (thanks to EPC), it will not block your Emacs while your are editing.
- EPC
- deferred.el (> v0.3)
- auto-complete
If your completion popup is broken when width of completion candidates is wide, try the newest version of popup.el.
Jedi.el is currently tested against Emacs 24.3-devel, 24.2 and 23.1.
- Jedi
- python-epc
- argparse (for Python 2.6)
Jedi.el is tested against Python 2.6, 2.7 and 3.2.
- virtualenv
- make
The easiest way to install Jedi.el is to use el-get: just do M-x el-get-install jedi
. You need to have virtualenv to automatically install Python module dependencies. If your el-get does not have the recipes for Jedi.el yet, get them from this pull request.
You can install Jedi.el using package.el interface from MELPA. As package.el does not support installing non-elisp packages, you need to install Python part manually (see the next section).
- Install EPC and auto-complete.
- Install Jedi.el. Download the repository of Jedi.el and add it to load-path.
- Install Jedi and python-epc by
make requirements
(no need for root privileges1) orpip install -r requirements.txt
if you want to determine where to install Python modules. You need root privileges (i.e.,sudo
) to install it in system directory.
- Add
(autoload 'jedi:setup "jedi" nil t)
in your Emacs configuration.
All you need to do is to call jedi:setup in python buffer. To do that, add the following in your Emacs configuration:
(add-hook 'python-mode-hook 'jedi:setup)
If auto-completion is all you need, use jedi:ac-setup instead:
(add-hook 'python-mode-hook 'jedi:ac-setup)
To setup recommended keybinds for Jedi.el, add this to your Emacs configuration. Note that you must set jedi:setup-keys before loading jedi.el. See its docstring (<f1> v jedi:setup-keys
) for more information.:
(setq jedi:setup-keys t)
Sometimes it is useful to find completion using Python interpreter. To do that in a seamless manner, you can use IPython and its Emacs binding EIN (Emacs IPython Notebook). See ein:jedi-setup in the EIN manual. Using this setup, you can run auto-completion command in Jedi.el and EIN simultaneously.
You need virtualenv for
make requirements
. It installs all requirements for Jedi EPC server in an isolated Python environment inenv/
directory under the directory where jedi.el locates. Note that you don't need to worry about if you want to use Jedi.el to complete modules in another virtualenv you made. Jedi EPC server recognize the virtualenv it is in (i.e., the environment variableVIRTUAL_ENV
in your Emacs) and then add modules in that environment to itssys.path
.↩