有没有办法改变 vim 多功能菜单的行为?
Omnicompletion 正在运行,但它会自动插入第一个结果。
我想要做的是打开全能菜单,然后能够键入以缩小结果范围,然后按 Enter 或 Tab 或空格或其他内容来插入所选的菜单项。
这可能吗?
Omnicompletion is working, but it automatically inserts the first result.
What I'd like to do is open the omnicomplete menu, then be able to type to narrow down the results, then hit enter or tab or space or something to insert the selected menu item.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您正在查找的命令是:
它将插入所有建议中最长的公共前缀,然后您可以键入并删除以缩小或扩展结果。
The command you are looking for is:
It will insert the longest common prefix of all the suggestions, then you can type and delete to narrow down or expand results.
找到此处。
还有一个很棒的插件可以满足您所有的完成需求,名为 SuperTab continue。
Found here.
There is also a great plugin for all of your completion needs called SuperTab continued.
这个插件可能会做你想做的事: autocomplpop< /strong>
或者你可以尝试让 Vim 完成弹出菜单 像在 IDE 中一样工作。
This plugin might do what you are after: autocomplpop
Or you can try and make Vim completion popup menu work just like in an IDE.
这是一般的 Vim 完成行为。 要获得完整的概述,您可以执行
“但对于您的具体情况”(您要求完成处于状态 2 或 3(在上面的文档中描述))。您可以简单地使用 Backspace 或 Control-H 从状态 1 跳转到在状态 2 中,您可以通过键入常规字符来缩小搜索范围:
我知道,这完全是反向的,但这就是它的工作
原理:您也可以使用向下箭头键而不是 Control。 -H 或 Backspace,它的好处是不删除字符。
This is the general Vim completion behaviour. For a complete overview, you can do
But for your specific case (which you require the completion to be in state 2 or 3 (described in the document above). You can simply use Backspace, or Control-H to jump from state one to state two. In state 2 you can narrow the search by typing regular characters. So to complete completion with narrowing:
It is totally backwards, I know, but that's how it works.
Edit: You can use the Down arrow key too isntead of Control-H or Backspace, and it has the benefit of not deleting a character.