VIM 中的自动代码完成?

发布于 2024-08-18 13:10:30 字数 152 浏览 6 评论 0原文

VIM 可以像 Eclipse 那样自动完成代码吗?通常我通过 Windows 笔记本电脑上的 Putty 连接到我的 Linux 开发服务器。所以,我希望我能找到一个 VIM 插件,当我在 Putty 中输入变量名称时,它可以实现下拉菜单,例如自动完成,这可能吗?

谢谢!

Can VIM do auto code completion like what Eclipse does? Usually I connect to my Linux developing server through Putty from my Windows laptop. So, I hope I can find a plugin for VIM which can do drop-down menu like auto completion when I can type variable names in Putty, is this possible?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

痴意少年 2024-08-25 13:10:30

是的,从某种意义上说 - Vim 有 Completion 命令,可以帮助你自动找到部分变量名称的完成文本。

简而言之,键入部分变量名称,然后按 CtrlP 搜索匹配的名称。

Yes, in a sense - Vim has Completion commands that can help you automatically find the completion text for partial variable names.

In a nutshell, type a partial variable name and then press CtrlP to search for a matching name.

卖梦商人 2024-08-25 13:10:30

是的,这是可能的。 Vim 已经内置了通用的代码补全风格,名为 Omni 补全。

默认安装不允许自动调用,但是如果你安装 这个脚本,这允许它发生。

请注意,根据您将使用的语言,您可能需要其他脚本来处理该语言的自动完成,甚至可能需要更改自动调用脚本以识别何时调用完成。由于您还没有说出您想要使用哪种编程语言,因此很难说您是否需要更多,但我建议您检查帮助文件。

Yes, it's possible. Vim already features that general style of code completion built-in, under the name of Omni completion.

The default installation doesn't allow for auto-invocation, but if you install this script, that allows it to happen.

Note that, depending on the language you'll be working with, you may need additional scripts to handle auto-completion for that language, and may even need to change the auto-invoke script to recognize when to invoke the completion. Since you haven't said what programming language you'll want to work with, it's a bit hard to say if you need more than this, but I recommend checking the help file.

谁的年少不轻狂 2024-08-25 13:10:30

尝试使用 http://eclim.org/ - 通过插件将 eclipse core 与 VIM 结合使用。

如果不启动完整的 ecplise 核心但有 C/C++ 成员完成,请尝试
http://www.vim.org/scripts/script.php?script_id= 1520

-   Complete namespaces, classes, structs and union members. 
-   Complete inherited members for classes and structs
(single and multiple inheritance). 
-   Complete attribute members eg: myObject->_child->_child etc...

Try to use http://eclim.org/ - using eclipse core with VIM via plugins.

To not start the complete ecplise core but have a C/C++ member completion, try
http://www.vim.org/scripts/script.php?script_id=1520

-   Complete namespaces, classes, structs and union members. 
-   Complete inherited members for classes and structs
(single and multiple inheritance). 
-   Complete attribute members eg: myObject->_child->_child etc...
终遇你 2024-08-25 13:10:30

目前 vim 没有用于自动代码完成功能的 插件,我正在使用 youcompleteme 插件,与 vim-snippetsultisnipssupertab 插件。您可以使用片段(可以展开为完整代码的小文本)来完成代码,并且支持大量语言。

对于简单的文本文件,还会出现一个下拉菜单,用于显示您之前输入的单词。

Currently vim has no of plugins for the auto code completion feature, I am using youcompleteme plugin, combined with vim-snippets, ultisnips and supertab plugins. You can tab complete the code using snippets (a small text which can be expanded for full code), and a large number of languages are supported.

For simple text files also a drop down menu comes for the words you have typed earlier.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文