introspective code completion with VIM? ... or other lightweight editor with this feature?
Question: I've been all over the web trying to find a way to get VIM to have code
completion similar to PyDev. It doesn't seem like it is possible!

-I have tried to use the omnicompletion suggested at this link: <http://blog.dispatched.ch/2009/05/24/vim-as-python-ide/> . 

-I have tried several addons to alleviate the problem, none work.

The "omnicomplete" functionality is NOT what I am looking for. It just takes
all the words in the file you are working on and uses those to try and
complete what I am doing. For example if I wrote:

    
    
    import numpy
    a_single_array = range(100)
    np.a#[then I hit cntrl+n to code complete]
    

It would spit out "a_single_array" as a possible completion -- but that is
absurd! That is not a valid completion for "numpy.a ..."

What is the issue here? All the addon would have to do is run a dir(work you
want to find) from the folder you are in and then filter the output! This
cannot be that difficult! (I suppose you would also have to read the file you
are currently editing and filter that as well to take note of name changes...
but that's pretty much it!)

Speaking of how easy it would be... if there isn't anything already made, I
was thinking of writing the script myself! Any guides on how to do THAT?


Answer: No, the omni completion functionality is EXACTLY what you are looking for.

You are using `<C-n>` instead of `<C-x><C-o>`:

  * type `<C-n>` & `<C-p>` to complete with words from the buffer (after and before the cursor respectively)
  * type `<C-x><C-o>` to complete method/properties names

It's specifically explained in the article you linked:

> In V7, VIM introduced omni completion – given it is configured to recognize
> Python (if not, this feature is only a plugin away) Ctrl+x Ctrl+o opens a
> drop down dialog like any other IDE – even the whole Pydoc gets to be
> displayed in a split window.

