Minimizing chunks of code

I have seen people using other txt editors to write code, but i really like the one SC comes with. The only thing i would give a kidney for, is to get a functionality like the one shown in the screenshot. Being able to minimize chunks of code would be just great!

1 Like

yes indeed! Code folding is one of the reasons I can’t leave scnvim for now…

1 Like

This could be a great feature for IDE

Code folding is one of the reasons I can’t leave scnvim for now…

huh, is there any particular setting that one needs to activate for this to work? Code folding works alright in nvim for me except in supercollider files, I always thought it just wasn’t implemented in scnvim…

you can to set the foldmethod for your document (:help foldmethod) - default is manual and here you can select a region and and fold using commands like zo zc etc.

you can also set it to use indentation :set foldmethod=indent.

for syntax aware folding you need to install tree-sitter and the tree-sitter parser for supercollider (GitHub - madskjeldgaard/tree-sitter-supercollider: SuperCollider grammar for the tree-sitter code parser), set foldmethod to expr and foldexpr to nvim_treesitter#foldexpr() - its pretty neat…

1 Like

It’s been discussed before – unfortunately, dev consensus is that it’s not an easy feature, and we’re stretched pretty thin as it is.

So, a couple ways forward:

  • Somebody rolls up their Qt sleeves and does it.
  • Or, use a different editor with code folding support (scnvim has been mentioned; there’s also an extension for vscodium which is not 100% complete I think? But fairly usable already.

hjh

Thanks! Couldn’t make the manual mode work but with the treesitter setting it works great!