github saberzero1/motions 0.47.0

latest releases: 1.4.0, 1.3.1, 1.3.0...
3 months ago

Added

  • Yank highlight — yanked text is briefly highlighted, providing visual feedback on what was yanked. Three modes available in Settings → Vim Motions → Vim features → Yank highlight: "Solid" (default, Neovim-style — instant appear, hold, disappear), "Fade" (gradual fade-out animation), or "Off". Duration is configurable via the Yank highlight duration slider (50–3000ms, default 200ms). Highlight color adapts to the active theme via --text-accent and can be overridden with the --vim-motions-yank-bg CSS custom property. Respects prefers-reduced-motion. Replaces the external obsidian-vim-yank-highlight plugin. (#53)
    • Works with remapped yank keys (detects actual yank operations via the vim-yank event, not keypress sniffing)
    • Handles rapid successive yanks (new highlight replaces previous), large yanks (>1000 lines skipped), and disposed views (tab close during highlight)
    • Requires bundled fork mode (built-in vim mode OFF) — the built-in vim does not emit the vim-yank event
    • Blockwise yank highlight deferred to a future release
    • Plugin: src/vim/yank-highlight.ts (new), src/main.ts, src/settings.ts, styles.css
  • Embedded table editing mode — new 'embedded' option for Settings → Vim Motions → Table widget in Live Preview. Tables render as themed HTML with a two-layer editing model:
    • Table navigation: h/j/k/l moves a cell highlight across the rendered table. j/k at the top/bottom row exits the table.
    • Cell editing: i/a/c/s/Enter opens a vim-enabled editor in the highlighted cell with full vim support (modes, motions, text objects, auto-formatting). Escape returns to table navigation; a second Escape exits the table. Tab/Shift-Tab moves between cells.
    • Table manipulation: o/O (add row below/above), dd (delete row), dc (delete column), J/K (move row down/up), H/L (move column left/right), I/A (add column left/right), = (realign). These operate directly on the raw markdown — no dependency on Obsidian's internal table commands.
    • Cell edits are written back per-cell with per-cell undo granularity.
    • Configurable via set tablewidget=embedded in vimrc or vim.opt.tablewidget = "embedded" in Lua.
    • Plugin: src/vim/table-nav-controller.ts (new), src/vim/table-cell-editor.ts (new), src/vim/table-operations.ts (new), src/vim/table-utils.ts (new), src/vim/table-render-widget.ts (modified: data attributes, embedded mode toggle, re-render guard), src/vim/table-embedded-editor.ts (rewritten), src/vim/table-auto-format.ts (getVimMode accepts EditorView), src/motions/tables.ts (exported helpers), src/main.ts, src/settings.ts, src/vim/options.ts, src/vimrc/loader.ts, styles.css

Changed

  • Oil explorer architecture rewritten — oil no longer creates temporary oil~*.md files in the vault. The directory listing is rendered in a dedicated oil-explorer view type with an embedded CodeMirror 6 editor, eliminating temp file visibility in tabs, search, and graph. Vim mode (both built-in and bundled fork) works natively in the embedded editor. View state (current directory) persists across workspace restarts via getState()/setState().
    • New: reusable EmbeddableMarkdownEditor abstraction (src/editors/embeddable-editor.ts) — extracts Obsidian's internal ScrollableMarkdownEditor prototype via app.embedRegistry and exposes a lightweight editor mountable in any DOM container with full CM6 + vim support. Designed for future use by the table editor and other features needing embedded markdown editing.
    • New: OilView custom view (src/oil/oil-view.ts) — extends View with view type 'oil-explorer', embedded editor with oil conceal extension, directory state management, and previous-file tracking for workspace restoration on close.
    • Changed: :q/:wq/:x/q in oil now restore the previously open file instead of leaving an empty workspace.
    • Changed: Oil keybinding registration uses vim.map with <CR> notation instead of vim.noremap with literal newline, fixing command execution in the embedded editor.
    • Changed: Lua vim.obsidian.oil.* callbacks call manager methods directly instead of routing through ex commands, fixing Lua API calls when no MarkdownView is active.
    • Removed: OIL_TEMP_PREFIX, tempToDir map, getTempFilePath(), forgetTempPath(), cleanupOrphanedTempFiles(), forceSourceMode(), userIgnoreFilters management, CSS .nav-file-title[data-path^='oil~'] hiding rule.
    • Migration: Legacy oil~*.md files from previous versions are automatically cleaned up on first load (cleanupLegacyTempFiles()).
    • Plugin: src/editors/embeddable-editor.ts (new), src/oil/oil-view.ts (new), src/oil/manager.ts (rewritten), src/oil/keybindings.ts (refactored), src/oil/render.ts (OIL_TEMP_PREFIX filter removed), src/workspace/commands.ts (OilView detection for :w/:wq/:x/:q), src/main.ts (registerView, Lua callbacks simplified), styles.css (OilView styling), test/specs/oil-poc.e2e.ts (rewritten for OilView, 16 tests)

Fixed

  • Oil confirm dialog button not focused — the confirmation dialog shown when deleting files now auto-focuses the Confirm button, matching pre-migration behavior.

Full Changelog: 0.46.0...0.47.0

Don't miss a new motions release

NewReleases is sending notifications on new releases.