{"id":32122445,"url":"https://github.com/ufukty/dim","last_synced_at":"2026-02-19T08:01:22.568Z","repository":{"id":162520093,"uuid":"637051248","full_name":"ufukty/dim","owner":"ufukty","description":"A Visual Studio Code extension lets you define regex rules to dim boring parts of code and make the main logic pop.","archived":false,"fork":false,"pushed_at":"2026-01-22T20:20:57.000Z","size":15488,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-23T05:39:48.734Z","etag":null,"topics":["productivity","vscode","vscode-extensions"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=ufukty.dim","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ufukty.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-06T11:00:58.000Z","updated_at":"2026-01-22T20:21:01.000Z","dependencies_parsed_at":"2024-01-13T11:56:29.199Z","dependency_job_id":"32327f8f-4be0-4e78-8b32-6b08e4e2bb75","html_url":"https://github.com/ufukty/dim","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ufukty/dim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ufukty%2Fdim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ufukty%2Fdim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ufukty%2Fdim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ufukty%2Fdim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ufukty","download_url":"https://codeload.github.com/ufukty/dim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ufukty%2Fdim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29608152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["productivity","vscode","vscode-extensions"],"created_at":"2025-10-20T20:48:28.044Z","updated_at":"2026-02-19T08:01:22.558Z","avatar_url":"https://github.com/ufukty.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dim\n\n![extension icon](media/icon.png)\n\nDefine rules to reduce opacity of repeating parts of code to make the main logic pop. Great for dimming Go's `if err != nil { return fmt.Errorf(...) }` error wrapping blocks and JavaScript's `console.log` calls.\n\n## Preview\n\nDim passes selections:\n\n![A screen recording of Visual Studio Code editor while the cursor is moved to show dimming is disabled whereever the user selects](/media/carets.sepsol.gif)\n\nDim can be temporarily turned off for a document:\n\n![Dim on Go code and toggling feature](/media/toggling.gif)\n\n\u003e Example code are on [Github Gist](https://gist.github.com/sepsol/af5d1252d7d5f029904100d802a8eaaf) for JavaScript and on [GitHub](https://github.com/ufukty/gohandlers-petstore/blob/main/handlers/pets/create.go) for Go. Themes are [Gruvbox Material](https://marketplace.visualstudio.com/items?itemName=sainnhe.gruvbox-material) and [Vitesse Black](https://marketplace.visualstudio.com/items?itemName=antfu.theme-vitesse).\n\n## Features\n\n-   Define rules based on standard **regex patterns**.\n-   Supports optional **regex flags**. With sensible defaults, for those who are not comfortable with flags.\n-   Matches both single line expressions and **blocks of code**.\n-   Allows **per-workspace** rules via `.vscode/config.json` file, and **per-language** rules through language tags `[js]`, `[go]`, `[json]` etc.\n-   Lets developers maintain high consistency of opacity values across every rule effortlessly by allowing them to assign only a **opacity tier** to rules. So, adjusting one tier's value is enough to update all rules using it.\n-   **Toggling** (enabling/disabling) the extension per document: `dim.toggleDimForCurrentEditor`.\n-   Dim respects **carets**. Means that Dim won't dim those areas that you are actively working on, or looking to.\n-   Checks matched ranges to see if the number of opening `{` and closing `}` **braces** inside the matched block are equal to eliminate problems like partial dimming of blocks or dimming incomplete parts of the code. (Experimental)\n\n## Performance\n\nDim designed to work with high performance even in lower end machines.\n\n-   No scroll hook. Some alternative extensions using scroll hook to apply decorations in visible ranges actually reduces the scroll performance in lower end machines. Dim performs scanning and applying decorations at document's first open, and after each content change with some delay.\n-   Uses regex match on whole document rather than walking the document line by line to invoke regex engine at each line.\n-   Robust editor lifecycle tracking. Dim tracks lifecycle updates that requires decoration updates or reusing same or different TextEditor instances for the document; does the needed and ignores the rest.\n-   Dim merges the intersecting ranges of different rules with same opacity tier, to avoid applying multiple decorations on one sequence of text.\n-   Dim is field tested for Code extension gotchas eg. constant feedback caused by applying decorations on log pane lead to infinite loop.\n-   Dim lets you adjust the update period according to your needs and hardware through `updatePeriod` property. Lower values increase the responsiveness of extension and higher values are better for lower end hardware.\n-   Dim reuses the same set of decorations per editor until the opacity values in config changes to avoid flickering issue which is enabled by performing decoration updates without requiring complete disposal of old ones.\n\n## Usage\n\n```json\n{\n    \"[go]\": {\n        \"dim.rules\": [\n            {\n                \"pattern\": \"if err != nil {.*?}\",\n                \"flags\": \"gs\",\n                \"opacity\": \"mid\"\n            },\n            {\n                // advanced version that forgives nested blocks and whitespaces\n                \"pattern\": \"if\\\\s+err != nil\\\\s*{(?:(?:[^{}]|\\\\n)*{(?:[^}]|\\\\n)*})?(?:[^}]|\\\\n)*}\",\n                \"flags\": \"gs\",\n                \"opacity\": \"mid\"\n            }\n        ]\n    },\n    \"[js]\": {\n        \"dim.rules\": [\n            {\n                \"pattern\": \"announce\\\\(.*\\\\);?\"\n            },\n            {\n                \"pattern\": \"logger\\\\.verbose\\\\([^\\\\n]*\\\\);?\"\n            }\n        ]\n    },\n    \"dim.rules\": [\n        {\n            \"pattern\": \"//.*\", // comment lines\n            \"opacity\": \"max\"\n        }\n    ],\n    \"dim.defaultFlags\": \"g\",\n    \"dim.defaultOpacityTier\": \"min\",\n    \"dim.valueForMinTier\": 0.2,\n    \"dim.valueForMidTier\": 0.3,\n    \"dim.valueForMaxTier\": 0.4\n}\n```\n\n## Suggestions\n\n-   Use proper escaping in pattern values; just like the examples above.\n-   Use singleline regex mode (with `s` flag) for block dimming rules. See [MDN page for regex flags](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions#advanced_searching_with_flags) or [this Stackoverflow answer](https://stackoverflow.com/questions/918806/difference-between-regular-expression-modifiers-or-flags-m-and-s) if you are not comfortable with the singleline mode.\n-   Assign a keyboard shortcut for toggling Dim for current document\n    ```json\n    {\n        \"key\": \"alt+cmd+h\",\n        \"command\": \"dim.toggleDimForCurrentEditor\"\n    }\n    ```\n\n## Contribution\n\nReport bugs to encourage me to fix them since knowing people using this extension is the only way to do it.\n\n-   Issues and PRs =\u003e https://github.com/ufukty/dim\n\n## Prior work\n\n-   dim has inherited some code and logic from https://github.com/lorefnon/lowlight-patterns\n\n## License\n\n-   See [LICENSE](LICENSE) file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fufukty%2Fdim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fufukty%2Fdim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fufukty%2Fdim/lists"}