4

Is there an autocomplete feature for Vi? ctrlp looks for keywords already used in the document. But suppose I want a.funcname to automatically show members of object a. Is it possible with Vi?

Melebius
  • 4,692
  • 3
  • 32
  • 43
Rohit Banga
  • 16,996
  • 26
  • 101
  • 179

6 Answers6

4

YouCompleteMe. It’s a plugin that offers extremely fast, fully syntax-aware auto-completion. It furthermore shows code errors on the fly (by putting a marker inside the margin next to the offending line).

So far, C++, C# and Python are natively supported. However, the plugin has an easily accessible API to add support for more languages.

There are other plugins but with the exception of Jedi (for Python only) nothing comes even close to working properly.

Konrad Rudolph
  • 482,603
  • 120
  • 884
  • 1,141
3

Take a look at supertab: http://www.vim.org/scripts/script.php?script_id=1643

wishi
  • 6,348
  • 14
  • 55
  • 92
3

I realise this isn't quite answering your question, but have you looked at running vi within an IDE ?

viPlugin works with Eclipse and is a pretty good vi emulation. Since it runs within Eclipse you get all the code completion that Eclipse provides. Eclipse isn't just for Java, btw. It works with a variety of languages and may well cater for what you need.

This is the direction I took when I reluctantly realised that vi by itself wasn't providing as much help as I needed when developing, but I was reluctant to give up the power of the editor.

Brian Agnew
  • 254,044
  • 36
  • 316
  • 423
2

I use NetBeans with the jVi plugin. It gives me the editing power of vi with the intelligent auto-completion features of NetBeans.

postfuturist
  • 20,913
  • 11
  • 57
  • 84
  • netbeans and eclipse are powerful editors themselves. why do you need vi plugins in them. – Rohit Banga Nov 05 '09 at 13:22
  • 2
    Honestly, its a different type of power. IDE's have powerful capabilities, like scanning a project and providing intelligent auto-completion, syntax highlighting, etc. Vi-style editing provides power at a low-level, pure text editing way. With the jVi plugin, you lose none of the underlying power of the IDE, so you get the best of both worlds. It's a win-win. Vi/vim is still *very* popular: http://answers.polldaddy.com/poll/2150554/ – postfuturist Nov 05 '09 at 16:48
1

It depends on your language. For c++, for example, there is omnicppcomplete.

maxaposteriori
  • 7,031
  • 3
  • 26
  • 24
0

Maybe this article will help, I haven't tried it to be honest but it looks suitable.

chrism1
  • 646
  • 1
  • 7
  • 12