I'm using vim 8.2 on Win 10. I want to enable markdown folding with the built-in markdown.vim.
But it will not work. I have tried solutions from other questions (e.g., Enable Expr Folding in Markdown and How to fold markdown using the built-in markdown mode?), but to no avail.
My vimrc contains...
My file is detected as markdown, as shown here...
detection:ON plugin:ON indent:ON
:set ft returns
:set foldmethod? returns
:scriptnames output includes...
27: C:\Program Files (x86)\Vim\vim82\ftplugin\markdown.vim 30: C:\Program Files (x86)\Vim\vim82\syntax\markdown.vim
I do not have a
vimwiki plugin (one user reported getting rid of vimwiki plugin solved the issue)
zo all result in
E490: No fold found, no matter where I place the cursor (on the
##, on the heading name, or inside the text associated with that heading)
I just found another question regarding this topic (No folding of markdown files) which contains what seems to be a solution, but which is a bit beyond my vim skill level. Does anyone recommend I try that solution? I'd rather not unless it truly is the only solution to my problem.
Further info per comments...
:verbose set foldmethod? returns
markdown.vim contains the following if-statement..
if has("folding") && exists("g:markdown_folding") setlocal foldexpr=MarkdownFold() setlocal foldmethod=expr setlocal foldtext=MarkdownFoldText() let b:undo_ftplugin .= " foldexpr< foldmethod< foldtext<" endif
has("folding") is true
exists("g:markdown_folding") is false
.. and the reason markdown_folding was false? ...a typo in my gvimrc (!)
I fixed the typo and folding is operational!