0

Possible Duplicate:
Vim autocomplete for Python

I use eclipse at work. Eclipse has this amazing feature where it can autocomplete based on methods and classes in your project space (as opposed to just autocompleting in just this file).

Does vim have plugins that provide similar capabilities?

i.e. if I defined foo() in a.py editing b.py and typing fo will result in foo() being suggested??

Community
  • 1
  • 1
xjq233p_1
  • 7,810
  • 11
  • 61
  • 107

1 Answers1

0

Vim doesn't provide auto-completion but it has what it calls omni-completion that is triggered by <C-x><C-o>. See :h new-omni-completion. There are other backends for Python omnicompletion like the promising Jedi or Pydiction. Try them if you don't like the default behaviour.

For omni-completion to become auto-completion, you'll need a third party plugin (yes, in case you didn't notice, Vim is a text editor, not an IDE) like AutoComplPop, which I use. Be sure to read the doc of the plugin you choose.

With that out of the way, after importing a module from a.py, typing that module name in b.py followed by a dot should show a contextual menu with a list of available methods and stuff.

romainl
  • 186,200
  • 21
  • 280
  • 313