Vim's Omnicompletion with Python just doesn't work

前端 未结 10 1021
悲&欢浪女
悲&欢浪女 2020-12-07 13:22

I\'ve searched around for an hour, both on Stack Overflow and elsewhere. Alas! Please help. Vim\'s omnicompletion just doesn\'t work.

  1. I have Vim 7.

10条回答
  •  Happy的楠姐
    2020-12-07 14:06

    Since you were prudent and made certain your code is reachable by the PYTHONPATH, per codeape's suggestion, is there a possibility that you are running into the import bug for Vim Python omni-complete? This bug still exists as of Vim 7.2.245.

    Essentially, if any import statement fails in the file you are working in, regardless of whether it's wrapped in a Try-Except clause, it will completely break omni-completion. It should be fairly easy to check for this, since most imports occur at the very beginning of the file.

    If you do decide that this bug is the cause of your troubles, your options include:

    • making sure that the modules you import are on the system path, not just the project files
    • commenting out any import statements that fail
    • fixing the bug
    • using ropevim as your completion method
    • using a different editor; Netbeans IDE has Python support, and the jVi plugin is rather good if you're a Vim addict like myself (don't let the 1990s look of the home page fool you)

提交回复
热议问题