Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm currently using superTab for completions in Vim. However, I'd like the completions to be more like 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.

Plugins are OK.

share|improve this question
1  
Please don't post the identical question on multiple sites: stackoverflow.com/questions/15697498/… –  Ingo Karkat Mar 29 '13 at 6:37
add comment

2 Answers

up vote 1 down vote accepted

I think the following plugin does what you're asking for:
YouCompleteMe

From the description:

YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for Vim. It has two completion engines: an identifier-based engine that works with every programming language and a semantic, Clang-based engine that provides semantic code completion for C/C++/Objective-C/Objective-C++ (from now on referred to as “the C-family languages”).

share|improve this answer
add comment

Putting set completeopt=menu,longest turns out to do the trick, mostly. Unfortunately entering some more text, then pressing tab again tries to do a full completion instead of giving the next longest common prefix.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.