{"id":21291678,"url":"https://github.com/jdtsmith/org-modern-indent","last_synced_at":"2026-01-26T18:54:47.840Z","repository":{"id":49349877,"uuid":"500911442","full_name":"jdtsmith/org-modern-indent","owner":"jdtsmith","description":"modern block styling with org-indent","archived":false,"fork":false,"pushed_at":"2025-02-25T16:58:04.000Z","size":95,"stargazers_count":200,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-25T17:39:46.294Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdtsmith.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2022-06-07T16:05:28.000Z","updated_at":"2025-02-25T16:58:08.000Z","dependencies_parsed_at":"2023-12-02T01:24:30.944Z","dependency_job_id":"9a56f504-8b94-4621-a9a2-e599876724c1","html_url":"https://github.com/jdtsmith/org-modern-indent","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdtsmith%2Forg-modern-indent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdtsmith%2Forg-modern-indent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdtsmith%2Forg-modern-indent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdtsmith%2Forg-modern-indent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdtsmith","download_url":"https://codeload.github.com/jdtsmith/org-modern-indent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243760559,"owners_count":20343651,"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":[],"created_at":"2024-11-21T13:39:05.567Z","updated_at":"2026-01-26T18:54:47.826Z","avatar_url":"https://github.com/jdtsmith.png","language":"Emacs Lisp","funding_links":[],"categories":["Visual Enhancements"],"sub_categories":[],"readme":"# org-modern-indent\n\nModern block styling with `org-indent`.\n\n[`org-modern`](https://github.com/minad/org-modern) provides a clean and efficient org style.  The blocks (e.g. source, example) are particularly nicely decorated.  But when `org-indent` is enabled, the block \"bracket\", which uses the fringe area, is disabled.\n\nThis small package approximately reproduces the block styling of `org-modern` when using `org-indent`.  It can be used with or without `org-modern`.  Recent versions support \"bulk-indented\" blocks nested within lists:\n\n\u003cimg width=\"716\" alt=\"image\" src=\"https://github.com/user-attachments/assets/7ca42ce7-dcfb-4c66-b5f4-1798a4fd4df5\" /\u003e\n\n\n## Updates\n- **v0.5.2**: Prevent `org-todo` capitalization issues.\n- **v0.5.1**: Small simplifications for block drawing.\n- **v0.5**: Another complete rewrite which substantially improves\n  performance and accuracy.  Now block detection uses `org-element`\n  and the block styling is implemented in\n  `before/after-change-functions`. Benefits include:\n  1. Higher performance and more reliable fontification.\n  2. Ability to detect and correctly treat _damaged_ blocks\n     (header/footer line altered or removed) as well as _merged_ blocks.\n  2. Caches all prefix strings for lower memory usage/GC churn.\n  3. No more \"runaway\" formatting when partial blocks are created:\n     only _real_ blocks (according to `org-element`) are fontified.\n  \n  Note that v0.5 implements indented block styling using display\n  properties on the indentation text, so navigation will \"skip over\"\n  it.\n- **v0.1**: features a complete re-write to use font-lock directly.  This\n  has a few benefits:\n  1. No longer relies on org-mode face names for recognizing\n     blocks, so `org-src-block-faces` can have arbitrary faces\n     applied, e.g. for different `src` languages, as in the screenshot.\n  2. Eliminates the \"race\" between font-locking and applying the prefix text properties.\n  3. Enables in-text bracket decorations for \"bulk-indented\" blocks, for example blocks situated\n     in an arbitrarily-nested plain list item.\n\n## Configure\n\n```elisp\n(use-package org-modern-indent\n  :load-path \"~/code/emacs/org-modern-indent/\"\n  ; or\n  ; :straight (org-modern-indent :type git :host github :repo \"jdtsmith/org-modern-indent\"))\n  :config ; add late to hook\n  (add-hook 'org-mode-hook #'org-modern-indent-mode 90))\n```\n\n\u003e[!IMPORTANT]\n\u003e `org-modern-indent` uses `org-indent`, and expects it to be enabled to achieve its formatting.  To activate `org-indent-mode` by default in all org files, set `org-startup-indented=t`.\n\n## Hints\n\n### Bulk-indented blocks (e.g. within lists):\n\nBulk-indented blocks have \"real\" (space/tab) indent applied and managed by org.  This extra indentation is applied by org on _top_ of the (fake, prefix-based) indentation used by org-indent.  To nest blocks properly within such indented content, e.g. in plain list items, you only have to begin the `#+begin` at the same level as the list element's text.\n\nAs an important principle, `org-modern-indent` does not alter the contents of the text in your org documents, not even indentation.  It just styles what is there.  To help achieve proper block bulk-indented alignment, here are a few ways to alter blocks indentation using org and other commands:\n\n- **Start things right**: Hit return after your last line of text (e.g in a list item), then immediately hit `C-c C-,` to create the desired block.  It will be indented at the right level:\n   ```org\n   - This list item contains a:\n       - sublist, which holds a block:\n\t     [C-c C-,] here\n   ```\n- **Move flush left**: Note: `M-{` will get you to the start of a block quickly.  `M-\\` at block start will move the block's first header line to column 0.  Then `M-S-left` (or `right`) will indent the full block.\n- **Indent rigidly**: `M-h` selects the entire block. Then `C-x TAB` enters \"rigid indent\" mode, after which `left`/`right` moves the entire block.\n- **Re-indent a block**: If you have a block that is partially aligned, perhaps with a \"hanging end\", like so:\n   ```org\n   - List 1\n       - List 2\n\t     #+begin_src lang\n\t\t   foo_lang(x)\n\t   #+end_src\n   ```\n  you can simply use `M-S-left/right` at block start (or in fact anywhere on the block header/footer) to `org-indent-block`.  Note that `org-src-preserve-indentation=nil` is an important setting, to allow org to (re-)indent blocks to respect the local indentation inside list and other elements.  Also note that (from `org-indent-region`): \n\n    \u003e **Note**\n    \u003e The function will not indent contents of example blocks, verse blocks and export blocks as leading white spaces are assumed to be significant there.\n\n### Font spacing\n\nThe default `fixed-pitch` font (from which `org-meta-line` inherits) has line spacing \u003e1.0 on some systems. This will introduce gaps _even if your default font is changed_, and `line-space` is nil.  To correct it, add: \n\n```elisp\n(set-face-attribute 'fixed-pitch nil :family \"Hack\" :height 1.0) ; or whatever font family\n```\n### The bracket style \n\nIf you'd like a different face than `org-meta-line` for the \"bracket\", configure the `org-modern-indent-bracket-line` face.\n\n### Related config\n\nOptionally, if you want to use [org-modern](https://github.com/minad/org-modern) too (I do), a suggested config:\n\n```elisp\n(use-package org-modern\n  :ensure t\n  :custom\n  (org-modern-hide-stars nil)\t\t; adds extra indentation\n  (org-modern-table nil)\n  (org-modern-list \n   '(;; (?- . \"-\")\n     (?* . \"•\")\n     (?+ . \"‣\")))\n  :hook\n  (org-mode . org-modern-mode)\n  (org-agenda-finalize . org-modern-agenda))\n```\n\nAlso optional; use org-bullets instead for nicely aligned bullet stars. \n\n```elisp\n(use-package org-bullets-mode\n  :ensure org-bullets\n  :config\n  :hook org-mode)\n```\n\n\n## Related packages\n\n- [`org-modern`](https://github.com/minad/org-modern): A modern org styling.  Works best without org-indent.\n- [`org-bullets`](https://github.com/sabof/org-bullets): Unicode heading bullet replacement.\n- [`org-superstar`](https://github.com/integral-dw/org-superstar-mode): Prettify headings and plain lists.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdtsmith%2Forg-modern-indent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdtsmith%2Forg-modern-indent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdtsmith%2Forg-modern-indent/lists"}