Vim 代码补全
是否可以让 Vim 为您完成代码,就像在任何其他 IDE 中一样(不仅仅是单词搜索,还包括类成员、方法等)?
可用的最佳选项/插件有哪些?
Is it possible to make Vim complete the code for you, like in any other IDE (not just word searching, but members of classes, methods etc.)?
What are the best options / plugins available?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Clang Complete 可让您使用 Clang 准确自动完成 C 和 C++
Clang Complete lets you use Clang for accurate auto-completion of C and C++
我相信,按照这个链接列表,您将能够离开任何 IDE,成为 vim 的忠实用户,查看一些可以帮助您使用 IDE 资源的插件...
I believe that following this list of links you will be able to leave any IDE and become a faithful user of vim, see some plugins that help you with IDE resources...
这有点过时了。 Vim 代码补全领域的一颗冉冉升起的新星是“YouCompleteMe”插件。请查看此处。
This is a little out dated. A rising star in Vim code completion is the "YouCompleteMe" plugin. Check it out here.
全方位完成绝对是最佳选择。使用 Ctrl+X Ctrl+O 在插入模式下实例化它。
我将它与 SuperTab 结合使用,以允许类似于 bash shell 的制表符补全。
Omni completion is definitely the way to go. Instantiate it in insert mode with Ctrl+X Ctrl+O.
I use it in conjunction with SuperTab as well to allow for tab completion similar to bash shell.
我自己不使用它,但我听说过 Omni Complete:
http://vim.wikia.com/wiki /Omni_completion
Vim Wiki 包含一些可能对自动完成单词有用的内容。
Don't use it myself but I have heard of Omni complete:
http://vim.wikia.com/wiki/Omni_completion
The Vim Wiki contains a couple of things that may be of use for auto completion of words.
你可以尝试字典补全,获取适合你语言的字典。 简单方法
如果您使用 C++ 编程,则有 ctag 和 cscope 以及 OmniCppComplete 插件的 。
希望它会有所帮助
You can try this out Dictionary completions, get dictionary for you language. Simple ways
if you are programming in c++, there are ctag and cscope and with OmniCppComplete plugin.
Hope it will help
这是可能的,但大多数人不这样做。
vim 是一个相当通用的编辑器,也就是说,它确实包含一些“代码完成”功能,例如单词完成等,但与 Delphi 的 IDE 等功能不同。
这样的系统可以通过编写 vim 脚本来添加 - vim 可以直接运行多种脚本语言,这使得这很容易,或者您可以通过外部脚本发送文件。
It's possible, but most people don't.
vim is a fairly generic editor, that said, it does contain some "code completion" features such as word completion, etcetera, but nothing like the likes of, say, Delphi's IDE.
Such a system could be added by scripting vim - vim can directly run several scripting languages that make this easy, or you could send the file through an external script.