Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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
Please don't post the identical question on multiple sites:… – Ingo Karkat Mar 29 '13 at 6:37
up vote 2 down vote accepted

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

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .