Loading ...
Sorry, an error occurred while loading the content.

Confused about omni-complete for Python

Expand Messages
  • Mike Hansen
    I m confused about omni-complete for Python. How should it work? Let s say that I type in the following on a .py file. import cgi form = cgi. At the . in
    Message 1 of 3 , Oct 31, 2006
    View Source
    • 0 Attachment
      I'm confused about omni-complete for Python.

      How should it work?

      Let's say that I type in the following on a .py file.

      import cgi

      form = cgi.

      At the . in insert mode I type Ctrl-X Ctrl-O.

      A bunch of errors pop up and the omni-complete fails.

      "Error detected while processing function pythoncomplete#Complete:

      Traceback (most recent call last):
      File "<string>", line 1, in ?
      NameError: name 'vimcomplete' is not defined
      E121: Undefined variable: g:pythoncomplete_completions
      E15: Invalid expression: g:pythoncomplet_completions
      Omni completion ...pattern not found.

      Shouldn't I get a list of attributes and methods from the cgi module?

      I have filetype plugin on in my vimrc.
      Is there any other setup I need to do to get it working?

      I downloaded the newer pythoncomplete.vim and installed it in the autoload
      directory.
      http://www.vim.org/scripts/script.php?script_id=1542

      Any ideas?

      Thanks,

      Mike
    • Aaron Griffin
      ... Do you get an error about pythoncomplete requiring python? What is the output of :version in vim?
      Message 2 of 3 , Oct 31, 2006
      View Source
      • 0 Attachment
        On 10/31/06, Mike Hansen <mhansen@...> wrote:
        > I'm confused about omni-complete for Python.
        >
        > How should it work?
        >
        > Let's say that I type in the following on a .py file.
        >
        > import cgi
        >
        > form = cgi.
        >
        > At the . in insert mode I type Ctrl-X Ctrl-O.
        >
        > A bunch of errors pop up and the omni-complete fails.
        >
        > "Error detected while processing function pythoncomplete#Complete:
        >
        > Traceback (most recent call last):
        > File "<string>", line 1, in ?
        > NameError: name 'vimcomplete' is not defined
        > E121: Undefined variable: g:pythoncomplete_completions
        > E15: Invalid expression: g:pythoncomplet_completions
        > Omni completion ...pattern not found.

        Do you get an error about pythoncomplete requiring python? What is
        the output of :version in vim?
      • Mike Hansen
        ... This in on my Windows XP box... It has +python/dyn In the Compilation section there s a -DDYNAMIC_PYTHON_DDL= python24.dll On my Kubuntu box... It has
        Message 3 of 3 , Oct 31, 2006
        View Source
        • 0 Attachment
          > -----Original Message-----
          >
          > On 10/31/06, Mike Hansen <mhansen@...> wrote:
          > > I'm confused about omni-complete for Python.
          > >
          > > How should it work?
          > >
          > > Let's say that I type in the following on a .py file.
          > >
          > > import cgi
          > >
          > > form = cgi.
          > >
          > > At the . in insert mode I type Ctrl-X Ctrl-O.
          > >
          > > A bunch of errors pop up and the omni-complete fails.
          > >
          > > "Error detected while processing function pythoncomplete#Complete:
          > >
          > > Traceback (most recent call last):
          > > File "<string>", line 1, in ?
          > > NameError: name 'vimcomplete' is not defined
          > > E121: Undefined variable: g:pythoncomplete_completions
          > > E15: Invalid expression: g:pythoncomplet_completions
          > > Omni completion ...pattern not found.
          >
          > Do you get an error about pythoncomplete requiring python? What is
          > the output of :version in vim?
          >

          This in on my Windows XP box...
          It has +python/dyn
          In the Compilation section there's a -DDYNAMIC_PYTHON_DDL=\"python24.dll\"

          On my Kubuntu box...
          It has -python

          The error I reported above is from the Windows box. There is a python24.dll
          on the Windows box. Although I have Python 2.5 installed on the Windows box.
          Should I uninstall Python 2.5, uninstall VIM. Install Python 2.4 and then
          install VIM?

          It looks like the VIM on Kubuntu was compiled without python. That is
          strange since Kubuntu is supposedly big on using Python. It's the VIM-gnome
          package. It's the only VIM7 that I could get to work on Kubuntu. I never
          could get VIM7 to compile from source.

          Any help would be appreciated.

          Thanks,

          Mike
        Your message has been successfully submitted and would be delivered to recipients shortly.