Automatically fold specific sections when files are opened.
When opening a file, automatically fold sections of the file that match the configured regex.
Auto fold rules can also be run on an already opened file with the command Run Auto Fold
Note that there are no default rules - you must configure custom-auto-fold.rules for this extension to do anything interesting.
Click here to see some example rule configurations.
For files that match the fileGlob pattern, each line is tested against the linePattern regex pattern. For each line (or the first line if firstMatchOnly is true) that matches the pattern, the cursor is moved to the line and the "Fold" command is run.
Once all the rules have been run, the cursor/selections and vertical scrolling are reset to what they were before.
This extension depends on VS Code or other extensions to define folding regions in the editor before running. You may want to adjust the custom-auto-fold.delay setting based on your VS Code performance for an optimal experience.