3

Inspired by Drew NEIL's course and the 'nested-folding' feature for Markdown files, I've installed the Vim-Markdown-Folding plugin, on my Vim (:version). The GitHub directory was copied into the ~/.vim/bundle directory (as required by the pathogen plugin) with:

$ git clone https://github.com/msprev/vim-markdown-folding.git

Then I added the required

let g:markdown_fold_style = 'nested'

line into my .vimrc-file as described in the :help markdown-folding-configuration file and got this wired error:

Error detected while processing BufEnter Auto commands for "<buffer=1>":
E117: Unknown function: mdfolding#foldtextupdate

when opening, saving, or even jumping into the (Vim-)window of any markdown file. Otherwise everything seems to work fine. However, every time the error occurs I have to confirm the reading and I really would like to settle any other potential complications.

  • looks like the plugin is not correctly installed – Christian Brabandt Oct 20 '16 at 10:02
  • @ChristianBrabandt: Thank you :) The GitHub directory was copied into the ~/.vim/bundle directory as required by the pathogen plugin with: git clone https://github.com/msprev/vim-markdown-folding.git. Do I have made some mistake? – alex Oct 20 '16 at 17:02
1

A bit of investigation

After finding the function in source file, with these lines preceding it:

if !has('python')
    echo "Error: Required vim compiled with +python"
    finish
endif

And installing the plugin (my Vim is built without python), I can easily get the same error:

Error detected while processing BufEnter Auto commands for "<buffer=1>":
E117: Unknown function: mdfolding#foldtextupdate

So :echo has('python') probably returns 0 for you, because your Vim either doesn't have python support at all or has only python3 support.

By the way, the authors of the plugins should use :echoerr for such cases, or users might ignore important error messages.

Plugin version

Please do keep in mind that you did not install the original version of the plugin. What you installed is actually a fork of Drew Neil's plugin -- it seems to try to optimize performance of folding, but also requires Vim with python support.

You can:

  • use original version of the plugin, which doesn't require python (your link to documentation points to this repository, actually):

    git clone https://github.com/nelstrom/vim-markdown-folding.git
    
  • change your Vim setup (if you really need this plugin)

  • report upstream about the issue, maybe fixing it requires only adding check for python3 feature (e.g., if !has('python') && !has('python3')), the author should know better anyway
  • Thank you very much for your help :) (1) I don't understand the first bullet point. Since I've installed/use exactly the "original version of the plugin", why do I need python at all? (2) How could I install the python support (python is installed). NB: here my Vim :version output. – alex Nov 1 '16 at 12:46
  • (3) Is it possible to show me the terminal command for installing the "original version of the plugin, which dosen't require python"? (In which case you may ignore point (2) above.) – alex Nov 1 '16 at 13:10
  • 1
    @alex, added git clone command to the post. Your question uses msprev/vim-markdown-folding, which is a fork of nelstrom/vim-markdown-folding. – xaizek Nov 1 '16 at 13:47
  • THANK YOU : ) It works. Could you please add a comment like: "Please do keep in mind that you did not installed the original version of the plugin. You installed actually a fork of Drew Neil's plugin -- which requires additionally python." – alex Nov 1 '16 at 14:05

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.