Closed stevepowell99 closed 9 years ago
The basic structure of the settings should be as in:
https://github.com/jamalsenouci/sublimetext-syntaxfold/blob/master/syntax_fold.sublime-settings
so if you copy and paste that code and just replace:
{
"name":"Example",
"startMarker": "'#Start",
"endMarker":"'#End"
},
with:
{
"name":"Knitr",
"startMarker": "
\\{r(.*)\\}", "endMarker":"
$"
},
then it should work, i'm not able to test it at the moment as I'm away from home and only have my chromebook with me so no sublime text. Let me know if that doesn't work and i'll have a look at it when I get back in a couple of days.
That works, thanks for clarification!
Hi I have been struggling with trying to get this to work with Markdown headers. e.g.
hide this too hide this
break here
Any help to get the folding t work with # ## style heading tags??
Thanks
you might want to look at smartmarkdown package - that can do hierarchical folding with ## style markdown.
Yeah I agree with Steve, it's best to go for a package specifically suited to markdown. This was more designed for folding code blocks which have a start and end marker.
Having said that I will add in the functionality to fold based on a single marker as it might be useful for another case and would only require a few more lines of code.
Ok so with the latest version you could achieve what you want using the regular expression "^#(?!#)" as your startMarker which is looking for a line starting with only one # so include that in your config like this
{
"name": "Markdown Headers",
"startMarker": "^#(?!#)"
}
Not quite clear how to use this. I want to fold knitr markdown code chunks I tried putting this in Packages/User/syntax_fold.sublime_settings but I don't get offered knitr as an option when I press shift F5. What do I need to add?