paradoxxxzero / emacs-jedi

Python auto-completion for Emacs

Home Page:http://tkf.github.com/emacs-jedi/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jedi.el - Python auto-completion for Emacs

Links:

What is it?

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.

Requirements

Emacs

If your completion popup is broken when width of completion candidates is wide, try the newest version of popup.el.

Python

Jedi.el is tested against Python 2.6, 2.7 and 3.2.

Optional dependencies for automatic installation:

  • virtualenv
  • make

Install

el-get

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.

Manual install

  1. Install EPC and auto-complete.
  2. Install Jedi.el. Download the repository of Jedi.el and add it to load-path.
  3. Install Jedi and python-epc by
    • make requirements or
    • pip install jedi epc if you want to determine where to install them.
  4. Add (autoload 'jedi:setup "jedi" nil t) in your Emacs configuration.

Setup

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)

Extension

IPython integration

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.

About

Python auto-completion for Emacs

http://tkf.github.com/emacs-jedi/