博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
eric6 jedi 使用_将Jedi与YouCompleteMe一起使用
阅读量:2518 次
发布时间:2019-05-11

本文共 3211 字,大约阅读时间需要 10 分钟。

eric6 jedi 使用

(In case you’re not familiar with it yet, 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.)

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

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

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

In contrast to jedi-vim, YCM does not only support Python, it also provides intelligent -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 ++提供基于的智能完成支持,并为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 .

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

More information and docs can be found at .

可以在找到更多信息和文档。

建立 (Setup)

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

要将YCM与一起 ,只需将以添加到.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 >> g :YcmCompleter GoToDefinitionElseDeclarationg :YcmCompleter GoToDefinitionElseDeclaration
< 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 .

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

For more information about YCM, refer to its .

有关YCM的更多信息,请参阅其 。

翻译自:

eric6 jedi 使用

转载地址:http://pjqwd.baihongyu.com/

你可能感兴趣的文章
git bash中不能显示中文
查看>>
常用算法
查看>>
SQL算术数字的默认类型
查看>>
正则表达式
查看>>
TCP/IP Socket
查看>>
How do I debug a published XBAP file in VS2010?
查看>>
单工、半双工和全双工的定义
查看>>
Hdu【线段树】基础题.cpp
查看>>
时钟系统
查看>>
BiTree
查看>>
5个基于HTML5的加载动画推荐
查看>>
水平权限漏洞的修复方案
查看>>
静态链接与动态链接的区别
查看>>
Android 关于悬浮窗权限的问题
查看>>
如何使用mysql
查看>>
android addRule()
查看>>
转:app store 注册账号生成证书上传app完整的教程
查看>>
dedecms 搬家流程
查看>>
POST提交大量数据,导致后面数据丢失
查看>>
To Do List
查看>>