masukomi / vim-markdown-folding

Fold markdown documents by section.
248 stars 43 forks source link

Clarify that `foldmethod` must be `expr` #30

Closed max-b closed 5 years ago

max-b commented 6 years ago

Perhaps this is just obvious to others, but I wasted a bunch of time trying to get this plugin to work with foldmethod=syntax. Setting foldmethod=expr fixed my issue. I'm not deeply familiar with the inner workings/best practices of vimscript, but it might help other noobs like me :-)

masukomi commented 5 years ago

@max-b I've updated the README to include the following troubleshooting

There are a variety of ways Vim can be instructed to "fold" things. When you add a plugin to support a new language / format the plugin will tell Vim "Hey here's the method to use for figuring out the start and end of a fold with this language". This plugin uses a foldmethod of expr. If it's not working run :set foldmethod? You should see foldmethod=expr. If you see something else then you've likely got some other Vim configuration overriding the setting in the plugin.

Please reopen this if you think more should be done / added