尝试让 vim 与 python 一起工作
我试图在 vim 7.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
我更改
setlocal omnifunc=pythoncomplete#Complete
为
setlocal omnifunc=python3complete#Complete.
但是当我按
时,我收到一条错误消息:
Error: Required vim compiled with +python3
E117: Unknown function: python3complete#Complete
如果我写:python3
我明白了
E319: Sorry, the command is not available in this version
Im trying to get code completion for python in vim 7.3. When I install vim I use this configuration:
./configure --prefix=${HOME}/vim73 --enable-python3interp=yes --with-python3-config-dir=/home/etobkru/Python3/lib/python3.1/config
make && make install
I copy this file:
http://vim.cybermirror.org/runtime/autoload/python3complete.vim
in to the ~/vim73/share/vim/vim73/autoload/
directory and in this file:./share/vim/vim73/ftplugin/python.vim
I change
setlocal omnifunc=pythoncomplete#Complete
to
setlocal omnifunc=python3complete#Complete.
But when I press <c-x, c-o>
I get an error message:
Error: Required vim compiled with +python3
E117: Unknown function: python3complete#Complete
and if I write :python3
I get
E319: Sorry, the command is not available in this version
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
删除所有自动完成尝试并忘记您的问题,安装 neocomplcache (脚本站点)
我遇到了与您完全相同的问题,这个脚本解决了我所有的自动完成需求,它的功能确实丰富,直到您需要它时您才会注意到它。
Delete any autocompletion attempts and forget about your problems, install neocomplcache (script site)
I had the exact same problem you had and this script solved all my autocompletion needs, its really feature rich and you won't notice its there until you need it.
这取决于你的 vim 版本以及操作系统如何提供 Python 和 Python3,是否同时支持 python 和 python3。否则,如果完全编译,那么您第一次使用的 Python 版本将被激活。
查看以下线程以及从那里链接的线程:
Vim 7.3:Python3 支持
It depends on your vim version and on how the OS provides Python and Python3, whether python and python3 are supported both. Else if compiled in at all, then the Python version you first use will be activated.
Check out the following thread and the one linked from there:
Vim 7.3: Python3 support