Vim スクリプト Gundo が正しく動作しない

Vim スクリプト Gundo が正しく動作しない

「python」をサポートする vim で問題が発生しています。

Ubuntu 11.04にgnome-vimをインストールしましたが、理論的には「python」をサポートしていますが、病原体そしてグンドF5 キーを押すと、次のメッセージが表示されます。

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

修正方法をご存知の方はいらっしゃいますか?

答え1

これを最近 (python3 のサポート付きで) 動作させるには、次の変数を に追加する必要があります.vimrc

let g:gundo_prefer_python3 = 1

そうしないと、「E117: 不明な関数: gundo#GundoShow」のようなエラーが発生します。

答え2

私はDebianのような環境を想定しています

  1. 得るvim ソース. ソースは Mercurial を使用してダウンロードしました。インストールされていない場合は、次の手順に従ってください。

    apt-getでMercurialをインストール

    次に、mercurialを使用してソースを取得します

    hg clone https://vim.googlecode.com/hg/ ~/vimpy2.7

  2. Python 2.7とPythonライブラリがインストールされていた

    apt-get で python をインストール python-dev

  3. 次のコマンドを使用してコンパイルします

    cd ~/vimpy2.7
    ./configure --with-features=huge --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config

  4. インストール


    インストールする

注意: 実行するにはroot権限が必要ですmake install

すべてがうまくいけば、vimは/usr/local/vimにインストールされているはずです。./usr/local/vimと入力し、vim内で入力して:version確認します。+python

答え3

私もあなたと同じエラーが発生しました。

どうやら、最近の変更Gundo で Python 3 サポートを有効にすると、機能しなくなります。

ストラヒニャ・マルコヴィッチスティーブ・ロスのリポジトリをフォークし、修正をプルリクエストした少なくともスティーブがバグを修正するまでは、Strahinjaのレポ代わりに、私にとっては問題なく動作します。

関連情報