7
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

company-jediを使ってemacsでpythonの補完

Posted at

company-modeの紹介記事はこちら

概要

jediは,pythonの補完用ツール.
company-jediは,company-modeでjediの補完を使うためのbackend.

python_screencast.gif

インストール

MELPAからインストール可能.

M-x package-install RET company-jedi RET

company-jediで必要なのはjedi-coreパッケージで,jediパッケージはいらないので注意.
jediパッケージはauto-complete用でむしろ邪魔.

設定

(require 'jedi-core)
(setq jedi:complete-on-dot t)
(setq jedi:use-shortcuts t)
(add-hook 'python-mode-hook 'jedi:setup)
(add-to-list 'company-backends 'company-jedi) ; backendに追加

jedi:complete-on-dottにすると.を入力したときにも(メソッドを)補完してくれる.
jedi:use-shortcutstにすると以下のショートカットキーが使える

  • M-. 定義へジャンプ
  • M-, 定義ジャンプから戻る

使い方

初回実行時のみ,

M-x jedi:install-server RET

でjediサーバをインストールする.
jediサーバがインストールされる場所はjedi:environment-rootで指定できる.

7
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?