Expandomatic

by Onsi Fakhouri
5
4
3
2
1
Score: 35/100
New Plugin

Description

This plugin has not been manually reviewed by Obsidian staff. Expand selection outward through word, sentence, paragraph, section, document — like VSCode's expand selection.

Reviews

No reviews yet.

Stats

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

Latest Version

Invalid date

Changelog

README file from

Github

Expandomatic

An Obsidian plugin that progressively expands the selection outward, modelled after VSCode's Expand Selection (Alt+Shift+→).

Usage

You'll need to assign the keybindings to Expand Selection and Shrink Selection yourself.

Press ⌃⇧⌘→ (Control+Shift+Command+Right Arrow) repeatedly to grow the selection one unit at a time. Each press wraps the current selection in the next larger syntactic unit. Moving the cursor or changing the selection manually resets the expansion.

Press ⌃⇧⌘← (Control+Shift+Command+Left Arrow) to shrink back through the expansion history one step at a time. Shrink only works while the selection exactly matches the last expanded selection — any manual change to the cursor or selection clears the history.

Expansion levels

Prose (default)

Press Selects
1st Word under cursor
2nd Full URL (if cursor is inside one), otherwise sentence
3rd Sentence
4th Paragraph (blank-line bounded)
5th+ Innermost section (heading + content), then parent sections outward
Last Entire document

Sentence detection uses punctuation heuristics (. ! ? followed by a capital letter or end of text). Single-letter abbreviations like U.S. and Dr. are not treated as sentence boundaries.

Inside a table

Press Selects
1st Word
2nd Cell content (between `
3rd Entire row
4th Entire table

Inside a fenced code block

Press Selects
1st Word
2nd Entire line
3rd Entire fenced block (from ``` to ```)

Inside a math block ($$...$$ or inline $...$)

Inline $...$:

Press Selects
1st Word/token
2nd Term (operator-bounded: + - * / = ^ , ( ) [ ] { })
3rd Entire $...$ (including delimiters)
4th Entire line

Block $$...$$:

Press Selects
1st Word/token
2nd Term
3rd Entire line
4th Entire $$ block

Installation

  1. Build: npm install && npm run build
  2. Copy main.js and manifest.json into <vault>/.obsidian/plugins/expandomatic/
  3. Enable the plugin in Settings → Community Plugins

Hotkeys can be rebound under Settings → Hotkeys by searching for "Expand Selection" or "Shrink Selection". The defaults are ⌃⇧⌘→ (expand) and ⌃⇧⌘← (shrink).

Development

npm install
npm run dev   # watch mode, rebuilds on save
npm run build # production build