9

I have Python 2.7.9 installed. And now I get the message that the Gundo plugin requires 2.4. Is there a workaround?

Here is my vimrc file:

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required

Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-surround'
Plugin 'easymotion/vim-easymotion'
Plugin 'scrooloose/nerdtree'
Plugin 'jlanzarotta/bufexplorer'
Plugin 'rstacruz/sparkup'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'jeffkreeftmeijer/vim-numbertoggle'
Plugin 'scrooloose/syntastic'
Plugin 'qpkorr/vim-renamer'
Plugin 'klen/python-mode'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'dhruvasagar/vim-table-mode'
Plugin 'shinokada/listtrans.vim'
Plugin 'gavinbeatty/vmath.vim'
Plugin 'sjl/gundo.vim'
Plugin 'tpope/vim-abolish'


" Bindings for Listtrans plugin
nmap  ;l   :call ListTrans_toggle_format()<CR>          
vmap  ;l   :call ListTrans_toggle_format('visual')<CR>

" Bindings for Gundo
nnoremap <F5> :GundoToggle<CR>

"_Bindings for vmath
"nmap          ++  vip++
"vmap          ++  VMATH_YankAndAnalyse()                     


" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

:syntax on
let NERDTreeQuitOnOpen=1

:set hlsearch

vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar 31 2015 23:56:29)
Included patches: 1-488, 576
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by buildd@
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
-clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   -perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       -python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            -ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        +mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim        -lm -ltinfo -lnsl  -lselinux -lacl -lattr -lgpm -ldl
  • 1
    Do you mean that Gundo doesn't work with your Python version? I believe it requires at least Python 2.4, but should work with any Python 2.4+. Seems to be working with 2.7.6 in my machine. – Łukasz Górski Feb 18 '16 at 14:36
  • It does indeed say that it requires 2.4+ but it still doesn't make sense. – user3467407 Feb 18 '16 at 15:02
  • How so? If it doesn't work and displays this message as an error explanation, then there's something wrong with your setup (Gundo doesn't communicate properly with Python, or at least not with this specific implementation you installed). If it works, it's just an information that you can't use Gundo with Python older than 2.4 (which is very old itself). Where exactly is this Python version requirement displayed? – Łukasz Górski Feb 18 '16 at 15:06
  • What is your Vim version? Please show :version output – Christian Brabandt Feb 18 '16 at 15:18
  • 5
    You have -python You need a Vim with +python or +python/dyn. Try installing vim-gtk from your package manager. – Christian Brabandt Feb 18 '16 at 20:34
7

Try the undotree plugin:

Someone asked me about the difference with Gundo, here is a list of differences, or advantages.

  1. Pure vimscript implementation and no 3rd-party libraries(like python) is needed, don't worry about performance, it's not such a big deal for vim to handle this. The only dependency is the 'diff' tool which always shipped with vim and even without 'diff' you still can use most of the features of this script.
  2. Realtime updated undo tree. Once you make changes, the undo tree will be updated simultaneously.
  3. Several useful marks, like current changeset, next redo changeset, saved changeset, etc.
  4. Toggle between relative timestamp and absolute timestamp.
  5. Realtime updated undo window.
  6. Ability to clear undo history.
  7. More customizable.

I've switched from Gundo to undotree about some years ago and it works very well.

4

Add this to your .vimrc

if has('python3')
    let g:gundo_prefer_python3 = 1
endif

I was getting similar error. The above worked for me (I am using Manjaro Linux, and installed community/python-neovim (Python 3 client for neovim)). Found at https://bitbucket.org/sjl/gundo.vim/issues/42/about-python3-support

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.