A Google Docs–style selection toolbar for Obsidian. Obsidian 的 Google 文件式選字工具列。
Select text, get a floating toolbar. No more typing ** by hand.
反白文字,工具列就浮出來。不用再手打 **。
Highlight any text in the editor and a small toolbar appears above the cursor:
| Button | Output | Toggles? |
|---|---|---|
| Heading | ## text |
Yes |
| Bold | **text** |
Yes |
| Italic | *text* |
Yes |
| Strikethrough | ~~text~~ |
Yes |
| Highlight | ==text== |
Yes |
| Inline code | `text` |
Yes |
| Link | [text](url) |
No |
| Clear formatting | strips markers | No |
Pressing Bold on text that is already bold removes the markers. The link and clear-formatting buttons are one-directional — pressing them again does not undo them.
Heading is the only block-level button. It applies ## to every line
the selection touches, not just the selected words. Select across two lines and
both become headings.
Cmd/Ctrl+B and Cmd/Ctrl+I behave exactly
as they do in stock Obsidian. The bubble is an additional entry point, not a
replacement.Editor API, so it attaches to
Canvas cards, sidebar embeds, and pop-out windows — places where
workspace.activeEditor is null and simpler implementations do nothing.Obsidian 1.4.0 or later.
Not yet in the community plugin store. Two options:
Manual
main.js, manifest.json and styles.css from the
latest release<your vault>/.obsidian/plugins/format-bubble/BRAT (for automatic updates)
Install BRAT, then add
<your-username>/obsidian-format-bubble as a beta plugin.
Settings → Format Bubble lets you hide any of the eight buttons individually. Changes apply immediately to open editors — no restart needed.
npm install
npm test # unit tests
npm run dev # watch build
npm run build # type-check + production build
formatting.ts (Markdown transforms) and positioning.ts (placement maths)
are pure functions — no DOM, no Obsidian imports — so the test suite runs in
plain Node in milliseconds.
To develop against a vault, symlink the repo into its plugins folder:
ln -s "$(pwd)" "/path/to/vault/.obsidian/plugins/format-bubble"
Note that iCloud does not sync symlinks reliably. For an iCloud-backed vault, copy the built files instead.
MIT © 朱劭恩
在編輯器裡反白任何文字,游標上方就會浮出一條小工具列:
| 按鈕 | 產生的語法 | 可切換? |
|---|---|---|
| 標題 | ## 文字 |
是 |
| 粗體 | **文字** |
是 |
| 斜體 | *文字* |
是 |
| 刪除線 | ~~文字~~ |
是 |
| 高亮 | ==文字== |
是 |
| 行內程式碼 | `文字` |
是 |
| 連結 | [文字](網址) |
否 |
| 清除格式 | 移除格式標記 | 否 |
對已經是粗體的文字再按一次粗體,標記會被移除。連結與清除格式不是切換式——再按 一次不會還原。
標題是唯一的區塊級按鈕。 它作用於選取範圍碰到的每一整行,而不只是選到的 那幾個字。選取跨越兩行,兩行都會變成標題。
Cmd/Ctrl+B、Cmd/Ctrl+I 與原生 Obsidian 行為完全相同。
氣泡是多一個入口,不是取代。Editor API,因此能掛上 Canvas 卡片、側欄嵌入編輯器與彈出視窗——
這些地方 workspace.activeEditor 是 null,用比較簡單的做法會完全沒有反應。Obsidian 1.4.0 以上。
尚未上架社群外掛,兩種方式:
手動安裝
main.js、manifest.json、styles.css<你的 vault>/.obsidian/plugins/format-bubble/BRAT(可自動更新)
安裝 BRAT 之後,把
<your-username>/obsidian-format-bubble 加為 beta 外掛。
「設定 → Format Bubble」可以個別隱藏八顆按鈕。修改後立即套用到已開啟的編輯器, 不需重啟。
npm install
npm test # 單元測試
npm run dev # 監看重建
npm run build # 型別檢查 + production build
formatting.ts(Markdown 轉換)與 positioning.ts(定位計算)都是純函式——不碰
DOM、不引用 Obsidian——所以測試在純 Node 環境下毫秒級跑完。
要在 vault 裡開發,把 repo symlink 進外掛資料夾:
ln -s "$(pwd)" "/path/to/vault/.obsidian/plugins/format-bubble"
注意 iCloud 無法可靠同步 symlink。iCloud 上的 vault 請改用複製檔案的方式。
MIT © 朱劭恩