I want to fold in markdown using the built in markdown plugin that I believe should come with the version of vim I have (Vi IMproved 8.1 (2018 May 18, compiled Apr 23 2019 20:02:08)
).
I am struggling to make the answers in the other question on this topic work for me.
I have no plugins installed, and I made my .vimrc
the most minimal it can be:
let g:markdown_folding = 1
let g:markdown_fenced_languages = ['vim', 'yaml', 'python', 'bash=sh', 'sql', 'git', 'make', 'html', 'css', 'javascript', 'js=javascript', 'json=javascript', 'xml']
syntax enable
set nocompatible
With this, if I open a markdown file, I see that it is highlighted correctly, and :set ft?
returns markdown
. However, :set foldmethod?
always returns manual
, and zc
returns E490: fold not found
.
I have no idea what I'm doing wrong, and I've run out of things to try. The only thing I can think of is that if has("folding")
from that built in plugin must be returning false, but I don't know what that syntax is or how to enable folding.
:filetype
... Do you seefiletype detection:ON plugin:ON indent:ON
? If you seeplugin:OFF
, then that might explain what you're seeing... Happy to turn this into an answer, if it turns out this is the cause of your issue... Cheers!:scriptnames
command to confirm/check that theftplugin/markdown.vim
script is being sourced. Please use the commands suggested and please edit the question to include your findings. (Ok to add a comment indicating you've done that, feel free to mention @filbranden and I'll get a notification about it.)