简体   繁体   English

Vim中类似Bash的代码完成?

[英]Bash-like code completion in vim?

I'm currently using superTab for completions in Vim. 我目前正在使用superTab在Vim中完成。 However, I'd like the completions to be more like bash. 但是,我希望完成操作更像bash。 For example, if I'm typing 例如,如果我输入

st

and the possible completions are 可能的完成是

struct, string

I'd like it to be completed to 我希望它能完成

str 

if I press tab, and ideally display a menu of possible completions. 如果我按Tab键,则理想情况下会显示可能完成的菜单。

Plugins are OK. 插件还可以。

EDIT: completeopt+=menu, longest does most of what I want, but after the menu pops up and I narrow it down some, pressing tab again does a full completion instead of giving the next longest common prefix. 编辑:completeopt + =菜单,最长执行我想要的大多数操作,但是在菜单弹出后我将其缩小一些,再次按Tab键将完全完成操作,而不是给出下一个最长的公用前缀。

:set completeopt+=longest

should do the trick. 应该可以。

A great resource for tweaking the completion is Make Vim completion popup menu work just like in an IDE . 调整补全的一个很好的资源是使Vim补全弹出菜单像在IDE中一样工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM