Click here for an introductory article on company-mode
jedi is a complementary tool for python. company-jedi is a backend for using jedi completion in company-mode.
Can be installed from MELPA.
M-x package-install RET company-jedi RET
Note that company-jedi requires the jedi-core package and not the jedi package. The jedi package is for auto-complete and is rather annoying.
(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) ;Add to backend
If you set jedi: complete-on-dot
to t
, it will complete (method) even when you enter .
.
The following shortcut keys can be used by setting jedi: use-shortcuts
to t
--Jump to M-.
definition
--Return from M-,
definition jump
Only at the first execution
M-x jedi:install-server RET
Install the jedi server with.
The location where the jedi server is installed can be specified with jedi: environment-root
.
Recommended Posts