Added
- Cursor-aware table editing in Live Preview — replaced the table cell bridge approach with a custom table rendering system. Tables display as themed HTML when the cursor is outside and switch to raw Markdown when editing. All vim motions, operators, and text objects work naturally on table content. (#19)
- Custom
TableRenderWidgetrenders markdown tables as HTML using Obsidian's CSS classes (cm-embed-block,markdown-rendered,table-wrapper,table-cell-wrapper) for full theme compatibility StateFieldprovidesDecoration.replacefor tables the cursor is NOT in; removes decoration when cursor enters- Table widget suppressor patches
RangeSetBuilder.prototype.addto suppress Obsidian's interactive table widget - Default mode: "Cursor-aware" — rendered table when cursor is outside, raw Markdown when editing
- "Always raw" mode keeps tables as plain Markdown at all times
- "Off" mode restores Obsidian's default interactive table editor
- Three-way setting: Settings → Vim Motions → Table widget in live preview
- Supports alignment markers (
:---,---:,:---:) in rendered tables
- Custom
- Vertical table cell navigation —
]r/[rmoves to the same column in the next/previous row, skipping separator rows - Table cell text objects —
i|/a|for operating on table cells with standard vim operators:i|: content between surrounding pipes (likei()a|: content plus the trailing pipe- Works with
d,c,y,v:di|deletes cell content,ci|changes it,yi|yanks it
- Table realignment —
:tablerealign(short::tablerea) ex command and<Leader>trmapping. Computes column widths across all rows, pads cells uniformly, and respects:---/---:/:---:alignment markers in separator rows. - Table auto-format on
|— CM6inputHandlerextension that realigns table columns when|is typed in insert mode. Typing||on a new line within a table generates a separator row (|---|---|). - Table manipulation keybindings —
<Leader>tprefix commands mapped to Obsidian's built-in table commands, inspired by vim-table-mode:<Leader>tm— insert table<Leader>to/tO— add row below/above<Leader>tJ/tK— move row down/up<Leader>tdd— delete row<Leader>tiL/tiH— add column right/left<Leader>tL/tH— move column right/left<Leader>tdc— delete column<Leader>tr— realign table
- Table ex commands — 15 ex commands for table manipulation:
:tableinsert,:tablerowafter,:tablerowbefore,:tablerowup,:tablerowdown,:tablerowdelete,:tablecolafter,:tablecolbefore,:tablecolleft,:tablecolright,:tablecoldelete,:tablealignleft,:tablealigncenter,:tablealignright,:tablerealign - Internalized monkey-around —
src/util/around.tsprovides safe prototype patching with automatic removal, replacing the externalmonkey-arounddependency - E2E test suite expansion: 28 tests in
table-cell-bridge.e2e.ts(cursor-aware rendering, widget suppression,j/knavigation through tables, separator row traversal, post-edit navigation, theme class verification, alignment rendering), 24 tests intables.e2e.ts(cell navigation, vertical navigation, text objects, realignment)
Fixed
- Cursor stuck on table separator after insert-mode edit — after editing a table cell in insert mode, Obsidian's async table handler repositions the cursor, preventing
kfrom crossing the separator row (|---|---|). Fixed with a customtableAwareMoveUpmotion that skips separator rows when moving up after a table edit. The motion detects the snap-back pattern and compensates by jumping two lines (over the separator) instead of one. Operator-pending context (dk) is excluded from the skip to preserve correct delete ranges. - Cursor-aware table rendering — the "Cursor-aware" mode now uses a custom read-only
TableRenderWidgetinstead of Obsidian's interactive table widget. Tables render as themed HTML when the cursor is outside, with no async cursor snap-backs or state corruption.
Changed
- Replaced
TableCellBridgeapproach (per-cell vim bridge) with cursor-aware table rendering. The bridge approach required maintaining vim state across Obsidian's cell-scoped editors; the new system suppresses Obsidian's widget and provides its own themed read-only widget via aStateField. tableWidgetModesetting default:'cursor'(cursor-aware rendering)- Legacy
suppressTableWidget: booleansetting migrated:true→'always',false→'off'
Documentation
KNOWN_LIMITATIONS.md: updated table navigation section with new features (vertical nav, text objects, realignment, auto-format); documented cursor-aware mode architectureREADME.md: updated table navigation description for cursor-aware rendering; addedi|/a|to text objects table,]r/[rto navigation, table text objects section, auto-format docs,<Leader>trand:tablerealignto commands
Full Changelog: 0.15.0...0.16.0