Rainbow Brackets

by yndarra
5
4
3
2
1
Score: 50/100
New Plugin

Description

Obsidian plugin: rainbow brackets by nesting depth, pair highlight at the cursor, unmatched brackets in red

Reviews

No reviews yet.

Stats

0
stars
downloads
0
forks
0
days
0
days
0
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
1
commits

Latest Version

9 hours ago

Changelog

Initial release: colors brackets by nesting depth, highlights the pair at the cursor, marks unmatched brackets in red.

README file from

Github

Rainbow Brackets for Obsidian

Makes nested brackets readable in plain Markdown text — like rainbow brackets in VS Code.

  • Colors by depth — (), [] and {} are colored by nesting level (4 colors, cycling). Both brackets of a pair share a color.
  • Pair at the cursor — the bracket next to the cursor and its match get a highlight.
  • Unmatched brackets — shown in red with a wavy underline. In [ ( ] only the ( is flagged.

Ignored: brackets inside inline code, code blocks, math ($...$) and frontmatter, escaped brackets (\(), and ordered list markers like 1) / a) at the start of a line.

Works in the editor (Live Preview and Source mode). Reading view is not affected. Desktop and mobile.

Installation

From Community plugins (once approved): Settings → Community plugins → Browse → search "Rainbow Brackets".

Manually: download main.js, manifest.json and styles.css from the latest release into <your vault>/.obsidian/plugins/rainbow-brackets/, then enable the plugin in Settings → Community plugins.

With BRAT: add yndarra/obsidian-rainbow-brackets.

Customizing colors

Create a CSS snippet (Settings → Appearance → CSS snippets) and override the variables:

body.theme-dark {
	--rb-0: #ffb20d;  /* level 1 */
	--rb-1: #da70d6;  /* level 2 */
	--rb-2: #4fc1ff;  /* level 3 */
	--rb-3: #6fdc8c;  /* level 4 */
	--rb-bad: #ff4d4d;                       /* unmatched */
	--rb-active-bg: rgba(255, 255, 255, .18); /* pair at the cursor */
}
body.theme-light { /* same variables for the light theme */ }

Development

No build step — main.js is the plugin itself. Tests: node --test.


По-русски

Плагин подсвечивает скобки в обычном тексте заметок: раскрашивает их по уровню вложенности, выделяет пару к скобке у курсора и показывает красным скобки без пары. Скобки в коде, формулах и маркеры списков вида 1) не трогает. Цвета можно поменять через CSS-сниппет (см. выше).

License

MIT