尝试让vim使用python

2024-09-30 05:26:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试在vim7.3中完成python的代码。安装vim时,我使用以下配置:

./configure --prefix=${HOME}/vim73 --enable-python3interp=yes --with-python3-config-dir=/home/etobkru/Python3/lib/python3.1/config 
make && make install

我复制这个文件: http://vim.cybermirror.org/runtime/autoload/python3complete.vim~/vim73/share/vim/vim73/autoload/目录和此文件中: ./share/vim/vim73/ftplugin/python.vim我改变了

^{pr2}$

setlocal omnifunc=python3complete#Complete.

但当我按<c-x, c-o>时,我收到一条错误消息:

Error: Required vim compiled with +python3
E117: Unknown function: python3complete#Complete

如果我写:python3我会得到

E319: Sorry, the command is not available in this version

Tags: 文件代码configsharehomeprefixmakeconfigure
2条回答

这取决于您的vim版本和OS如何提供Python和Python3,以及Python和Python3是否同时受支持。否则,如果编译了,那么您第一次使用的Python版本将被激活。在

检查以下线程和从那里链接的线程: Vim 7.3: Python3 support

删除任何自动完成尝试并忘记您的问题,安装neocomplcache(script site)

我遇到了和你完全相同的问题,这个脚本解决了我所有的自动完成需求,它的功能非常丰富,你不会注意到它在那里,直到你需要它。在

相关问题 更多 >

    热门问题