eric6 jedi 使用_将Jedi与YouCompleteMe一起使用

eric6 jedi 使用

(In case you’re not familiar with it yet, Jedi is an awesome autocompletion library for Python that tries to understand your code. There are editor plugins available for Vim, Emacs and Sublime Text 2.)

(如果您还不熟悉它, Jedi是一个很棒的Python自动补全库,它试图理解您的代码。有一些Vim,Emacs和Sublime Text 2可用的编辑器插件。)

The “official” Jedi plugin for vim is jedi-vim, but there’s another vim autocompletion plugin that supports Jedi: YouCompleteMe.

vim的“官方” Jedi插件是jedi-vim ,但是还有另一个支持Jedi的vim自动完成插件: YouCompleteMe

In contrast to jedi-vim, YCM does not only support Python, it also provides intelligent Clang-based completion support for C/C++/Objective-C/Objective-C++ as well as omnicomplete based semantic completions for Ruby, PHP and more.

与jedi-vim相比,YCM不仅支持Python,而且还为C / C ++ / Objective-C / Objective-C ++提供基于Clang的智能完成支持,并为Ruby,PHP等提供基于omnicomplete的语义完成。

The way YCM works is by automatically showing completion suggestions while typing, without the need for a trigger key. Another feature that distinguishes it from other autocompletion plugins is that the filtering of possible completions is not based on the prefix, but using subsequence matching instead. To quote the YCM author, this is a fancy way of saying that any input characters need to be present in a completion string in the order in which they appear in the input. So abc is a subsequence of xaybgc, but not of xbyxaxxc. And as yet another bonus, YCM features integration with UltiSnips.

YCM的工作方式是在键入时自动显示完成建议,而无需触发键。 与其他自动补全插件不同的另一个功能是,可能补全的过滤不是基于前缀,而是使用子序列匹配。 引用YCM作者的话,这是一种花哨的说法,任何输入字符都必须按照它们在输入中出现的顺序出现在补全字符串中。 因此abcxaybgc的子序列 ,而不是xbyxaxxc的子序列 。 此外,YCM还具有与UltiSnips集成的功能。

More information and docs can be found at http://valloric.github.io/YouCompleteMe/.

可以在http://valloric.github.io/YouCompleteMe/中找到更多信息和文档。

建立 (Setup)

To use YCM with vundle, simply add the following line to your .vimrc:

要将YCM与vundle一起使用 ,只需将以下行添加到.vimrc中

Bundle Bundle 'Valloric/YouCompleteMe'
'Valloric/YouCompleteMe'

Then let vundle install the new bundle:

然后让vundle安装新的捆绑包:


$ vim +BundleInstall +qall

In order for YCM to work, you need to compile the core. Use the --clang-completer argument if you want semantic support for C family languages.

为了使YCM正常工作,您需要编译内核。 如果要对C族语言进行语义支持,请使用--clang-completer参数。


$ cd ~/.vim/bundle/YouCompleteMe
$ ./install.sh --clang-completer

组态 (Configuration)

In my .vimrc I currently use only two configuration lines. The first enables auto closing of the preview window when the user accepts the offered completion string.

在我的.vimrc中,我目前仅使用两条配置行。 当用户接受提供的完成字符串时,第一个启用自动关闭预览窗口。

The next line maps Jedi’s jump to definition/declaration feature to the <leader>g shortcut:

下一行将Jedi的跳转到定义/声明功能映射到<leader> g快捷方式:

 nnoremap nnoremap <leader< leader >> g :YcmCompleter GoToDefinitionElseDeclarationg :YcmCompleter GoToDefinitionElseDeclaration <CR< CR >
>

更多信息 (Further Information)

jedi-vim and YCM are currently not compatible. You have to choose one of them.

jedi-vim和YCM当前不兼容。 您必须选择其中之一。

YCM’s integration with Jedi is still under development. As soon as all features are implemented (pydoc is not included yet, for example), it might even replace jedi-vim as the “officially endorsed” completion plugin. You can find more information in jedi-vim issue #119.

YCM与Jedi的整合仍在开发中。 一旦实现了所有功能(例如,尚不包含pydoc),它甚至可能取代jedi-vim作为“官方认可”的完成插件。 您可以在jedi-vim问题#119中找到更多信息。

For more information about YCM, refer to its extensive documentation.

有关YCM的更多信息,请参阅其广泛的文档

翻译自: https://www.pybloggers.com/2013/05/using-jedi-with-youcompleteme/

eric6 jedi 使用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值