如何在emacs中使用elpy正确设置Jedi? [英] How to properly setup Jedi with elpy in emacs?

查看:73
本文介绍了如何在emacs中使用elpy正确设置Jedi?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有elpy的emacs作为使用python代码的模式.我还安装了Jedi,主要用于两件事:转到它提供的定义功能和自动完成功能.

I am using emacs with elpy as mode for working with python code. I have also installed Jedi for, mainly, two things: go to definition functionality it provides and autocompletion.

但是,我在此设置中遇到了以下问题:

However, I have run into the following problems with this setup:

  1. Jedi完成不是由键盘命令触发的.它会自动出现,但有时对于我的口味来说太晚了,我希望尽早尝试并调用它.但是,尽管自定义页面中有一个Jedi:Key complete选项,但它似乎没有任何效果.另一方面,elpy的公司模式快捷方式是在 C-M-i 上实现的.
  2. 同时打开Jedi和company-mode时,有时会出现两个完成列表(具有相同的内容;我还安装了公司jedi后端)-但只有其中一个允许更改选择(来自Jedi的完成列表),但在输入时使用公司的选择.这不可用.

有什么方法可以设置东西,以便我可以使用jedi后端和jedi的go go定义从单一来源自动完成?

Is there any way to setup things so that i will have autocompletion from a single source with jedi backend and jedi's go to definition?

这是我当前在 init.el 中设置jedi的方式:

This is how i currently setup jedi in my init.el:

(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)

推荐答案

根据elpy的文档,您只需要安装elpy软件包.然后使用下面的配置

According to the document of elpy, you just need to install elpy package. Then use the config below

(elpy-enable)  
(setq elpy-rpc-backend "jedi")  

仅此而已.您可以访问 https://github.com/jorgenschaefer/elpy 以获得更多信息.

That's all. You can visit https://github.com/jorgenschaefer/elpy for more information.

这篇关于如何在emacs中使用elpy正确设置Jedi?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆