{"id":13448351,"url":"https://github.com/jamalsenouci/sublimetext-syntaxfold","last_synced_at":"2025-03-22T09:31:17.544Z","repository":{"id":20593970,"uuid":"23874781","full_name":"jamalsenouci/sublimetext-syntaxfold","owner":"jamalsenouci","description":"Sublime Text Plugin that provides a configurable command and popup for folding code based on syntax","archived":false,"fork":false,"pushed_at":"2021-11-07T09:59:07.000Z","size":33,"stargazers_count":40,"open_issues_count":14,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-28T14:27:24.567Z","etag":null,"topics":["fold","python","sublime-text"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamalsenouci.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-10T13:08:28.000Z","updated_at":"2023-06-11T17:43:42.000Z","dependencies_parsed_at":"2022-07-07T15:52:09.334Z","dependency_job_id":null,"html_url":"https://github.com/jamalsenouci/sublimetext-syntaxfold","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamalsenouci%2Fsublimetext-syntaxfold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamalsenouci%2Fsublimetext-syntaxfold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamalsenouci%2Fsublimetext-syntaxfold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamalsenouci%2Fsublimetext-syntaxfold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamalsenouci","download_url":"https://codeload.github.com/jamalsenouci/sublimetext-syntaxfold/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244937751,"owners_count":20535124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fold","python","sublime-text"],"created_at":"2024-07-31T05:01:42.918Z","updated_at":"2025-03-22T09:31:17.112Z","avatar_url":"https://github.com/jamalsenouci.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# SyntaxFold - Sublime Text Plugin\n\nA plugin for [Sublime Text][st] 3 that folds/collapses or unfolds/expands code blocks based on specific syntax defined by the User rather than indent.\n\n\u003ci\u003eNote: This plugin does not create folding markers (the functionality for creating these markers is not exposed within the Sublime Text API). The folding functionality provided by this plugin relies on using keyboard shortcuts assigned by the User or by invoking fold commands through the command panel.\u003c/i\u003e\n\n## Background\nThis plugin was created for any language that uses named regions similar to languages like VB, C++ and C# (see [here][vs]). Where possible, use a plugin created specifically for your syntax.\n\nExpanding and collapsing areas is also supported in non-source files, such as text files (Sublime Text regards HTML as belonging to a `text` scope name).\n\n## Installation\n* Use [Sublime Package Control](http://wbond.net/sublime_packages/package_control \"Sublime Package Control\")\n* \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eP\u003c/kbd\u003e then select `Package Control: Install Package`\n* Type `SyntaxFold` and press \u003ckbd\u003eENTER\u003c/kbd\u003e\n\nAlternatively Clone this repository to your Sublime Text packages directory.\n\n### Setup\nThe settings file can be accessed through `Preferences -\u003e Package Settings -\u003e Settings - User`.  It will be initially populated with the following settings.\n\n```json\n{\n    \"config\":[\n        {\n            \"scope\": \"source.java, source.js, embedding.php\",\n            \"startMarker\": \"//region\",\n            \"endMarker\":\"//endregion\"\n        },\n        {\n            \"scope\": \"source.cs\",\n            \"startMarker\":\"#region\",\n            \"endMarker\":\"#endregion\"\n        },\n        {\n            \"scope\": \"source.c++, source.c\",\n            \"startMarker\":\"#pragma region\",\n            \"endMarker\":\"#pragma endregion\"\n        },\n        {\n            \"scope\": \"text.html.basic\",\n            \"startMarker\":\"\u003c!--region--\u003e\",\n            \"endMarker\":\"\u003c!--endregion--\u003e\"\n        },\n        {\n            \"scope\": \"text.plain\",\n            \"startMarker\":\"---region---\",\n            \"endMarker\":\"---endregion---\"\n        }\n    ]\n}\n```\n\nAdd or remove fold region objects to meet your needs.  Note the `scope` key. Utilize this key to filter which source file types for which the start and end markers are active. To determine the scope name for a file type use `Tools -\u003e Developer -\u003e Show Scope Name` or \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eP\u003c/kbd\u003e.\n\nThe `scope` key may contain a comma separated list of scopes for which the markers should be active. The settings file above supports, for example, Java, Javascript and PHP files folding through the same `//region` and `//endregion` markers since the defined scope is `\"source.java, source.js, embedding.php\"`.\n\n\n## Usage\nUse the [keybindings](#command-examples) to fold/unfold your code\n\n### Key Bindings ###\n\nThe following is an excerpt of the default key bindings:\n\n```js\n[\n//Fold all code blocks\n  { \"keys\": [\"alt+0\", \"alt+0\"],\n    \"command\": \"fold_all\" },\n\n// Unfold all code blocks\n  { \"keys\": [\"alt+shift+0\", \"alt+shift+0\"],\n    \"command\": \"unfold_all\"},\n\n// Toggle fold current code block\n  { \"keys\": [\"alt+1\", \"alt+1\"],\n    \"command\": \"toggle_fold_current\"},\n]\n```\n\n### Command Reference\n\nA list of commands have been added to the command palette and can be accessed using \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eP\u003c/kbd\u003e.\nAll commands start with \"SyntaxFold : [command name]\".\n\n***Fold All***:\nFold/collapse all syntax delimited blocks in the current document.\n\n***Unfold all***:\nUnfold/expand all syntax delimited blocks in the current document.\n\n***Toggle Fold Current***:\nFolds/collapses or Unfolds/expands the syntax delimited block where the cursor is placed on.\n\n***Open README***:\nOpen this readme file.\n\n### Saving fold state\n\nThis package doesn't support saving the folded state of a file (remembering which blocks you have folded) but there is a package called BufferScroll perfectly suited to that https://packagecontrol.io/packages/BufferScroll\n\n\n\u003c!-- Links --\u003e\n[vs]:http://blogs.msdn.com/b/zainnab/archive/2013/07/12/visual-studio-2013-organize-your-code-with-named-regions.aspx\n[st]: http://sublimetext.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamalsenouci%2Fsublimetext-syntaxfold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamalsenouci%2Fsublimetext-syntaxfold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamalsenouci%2Fsublimetext-syntaxfold/lists"}