Tengo problemas con mi vim compatible con "python".
Había instalado gnome-vim, en Ubuntu 11.04, que teóricamente tiene soporte para "python", pero si lo instalopatógenoygundo, cuando presiono F5, se muestra el siguiente mensaje:
Error detected while processing /home/perseus/Coding/LinuxConfigFiles/.vim/bundle/gundo/autoload/gundo.vim:
line 22:
E837: This Vim cannot execute :py3 after using :python
line 30:
E121: Undefined variable: s:has_supported_python
E15: Invalid expression: !s:has_supported_python
Error detected while processing function gundo#GundoToggle..<SNR>26_GundoToggle..<SNR>26_GundoOpen:
line 2:
E121: Undefined variable: s:has_supported_python
E15: Invalid expression: s:has_supported_python == 2
line 10:
E121: Undefined variable: s:has_supported_python
"__Gundo_Preview__" [New File]
Error detected while processing function gundo#GundoToggle..<SNR>26_GundoToggle..<SNR>26_GundoOpen..<SNR>26_GundoRenderGraph:
line 1:
E121: Undefined variable: s:has_supported_python
E15: Invalid expression: s:has_supported_python == 2
Error detected while processing function gundo#GundoToggle..<SNR>26_GundoToggle..<SNR>26_GundoOpen..<SNR>26_GundoRenderPreview:
line 1:
E121: Undefined variable: s:has_supported_python
E15: Invalid expression: s:has_supported_python == 2
¿Alguien sabe como arreglarlo?
Respuesta1
Para que funcione hoy en día (con soporte para Python3), debe agregar la siguiente variable a su .vimrc
:
let g:gundo_prefer_python3 = 1
De lo contrario, se encontrará con errores como: "E117: Función desconocida: gundo#GundoShow"
Respuesta2
Supongo que es un entorno similar a Debian.
Conseguirfuente vim. Descargué la fuente usando mercurial. Si no lo tienes instalado:
apt-get instalar mercurial
Luego, obtén la fuente usando mercurial.
hg clone https://vim.googlecode.com/hg/ ~/vimpy2.7
Tenía Python 2.7 instalado y una biblioteca de Python.
apt-get instalar python python-dev
Compile usando el siguiente comando
cd ~/vimpy2.7
./configure --with-features=huge --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/configInstalar
hacer
hacer instalar
Observación: Es necesario ser root para ejecutarmake install
Si todo funciona, vim debe instalarse en /usr/local/vim. escriba ./usr/local/vim, escriba dentro de vim :version
y verifique+python
Respuesta3
Recibí los mismos errores que tú.
Al parecer, uncambio recientea Gundo habilitar la compatibilidad con Python 3 lo ha roto.
Strahinja Markovicha bifurcado el repositorio de Steve Losh ypull-solicitó la solución. Al menos hasta que Steve solucione el error, le sugiero que utiliceEl repositorio de Strahinjaen cambio, funciona bien para mí.