I'm editing python files and I have a modeline in one of them as follows:
# vim: set foldmarker={{{,}}} foldlevel=0 foldmethod=marker
When I open the file, foldmethod
is still set to expr
, but the other two settings in the modeline have been successfully applied, and set modeline?
reveals that modeline
is indeed set.
I suspect this is happening because a plugin is overriding the setting after the modeline is applied, but how can I check if that's the case?
Actually, your modeline syntax is incorrect. You are setting foldmarker
and foldlevel
to the default values, so that's probably why it looks like those settings are being applied. Your modeline should be
# vim: set foldmarker={{{,}}} foldlevel=0 foldmethod=marker :
Note the :
at the end of the line, it is required.
There is another syntax for modelines that doesn't require the closing colon but it also cannot have a leading set:
# vim: foldmarker={{{,}}} foldlevel=0 foldmethod=marker
Either one will work for you. I tend to use the first syntax because the second cannot be used in languages where you need some text at the end of the line to close the comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With