github saberzero1/motions 0.52.0

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

Added

  • Cursor line highlight — set cursorline / set nocursorline with cursorlineopt (number/line/both). Compartment-based runtime switching.
  • Fold column — set foldcolumn shows ▸/▾ indicators for foldable regions with click-to-fold. Uses CM6 foldable() / foldedRanges() APIs.
  • numberwidth option — set numberwidth=N controls minimum line number column width (1–20, default: 2).
  • Mobile gutter width reduction — line number gutter uses smaller font and reduced width on viewports ≤ 600px.
  • Configurable line number gutter — set number, set relativenumber, or both for hybrid mode (absolute on current line, relative on others), matching Neovim's semantics exactly. Uses a custom CM6 gutter() with Compartment-based runtime switching — :set number / :set nonumber take effect instantly without full feature reload. When the plugin's line number gutter is active, Obsidian's native line numbers are suppressed via CSS to prevent duplication. Defaults to off (matching Neovim defaults).
    • Settings: Settings → Vim Motions → Line numbers — two toggles: Line numbers, Relative line numbers
    • Vimrc: set number / set nonumber (alias nu), set relativenumber / set norelativenumber (alias rnu)
    • Lua: vim.opt.number = true, vim.opt.relativenumber = true
    • Plugin: src/vim/line-number-gutter.ts (new), src/settings.ts, src/vim/options.ts, src/vimrc/loader.ts, src/main.ts, styles.css
  • Picker provider API — external plugins can register custom picker sources via window.VimMotions.picker.registerSource(). The API validates namespaced source names (pluginId:sourceName), wraps external source methods in try/catch with 5-second timeout, caps results at 10,000 items, and emits source-registered / source-unregistered events. Consumer plugins discover the API via window.VimMotions.picker or app.plugins.plugins['vim-motions'].pickerAPI.
    • Lifecycle: vim-motions:picker-ready workspace event fires after API installation; consumers use onLayoutReady + event listener pattern for load-order safety.
    • Type definitions: src/picker/picker-api.d.ts ships standalone types for consumer plugins with full JSDoc and usage examples.
    • Plugin: src/picker/api.ts (new), src/picker/picker-api.d.ts (new), src/picker/registry.ts (extended), src/picker/types.ts (metadata fields), src/main.ts (API wiring)
  • Meta-picker — :Picker (no arguments) opens a source browser listing all registered picker sources grouped by "Built-in" / "Extensions", with display names, icons, and keymap bindings shown. Selecting an entry opens that picker. :Picker <source> opens a named source directly.
    • Plugin: src/picker/sources/pickers.ts (new), src/workspace/commands.ts (:Picker ex command), src/main.ts (picker-pickers Obsidian command)
  • Picker source metadata — PickerSource interface extended with optional displayName, icon, description, and priority fields. All 12 built-in sources now include metadata for display in the meta-picker.
    • Plugin: src/picker/types.ts, src/picker/sources/*.ts (all 12 source files)
  • Bundled picker integrations — three built-in picker sources that auto-detect and integrate with popular plugins:
    • Omnisearch (omnisearch) — dynamic full-text vault search via globalThis.omnisearch.search(). 150ms debounce, min 2-char query. Jumps to first match offset on selection.
    • Obsidian Tasks (tasks) — shows all incomplete tasks sorted by due date, grouped by status type. Cached with event-based invalidation via obsidian-tasks-plugin:cache-update. Jumps to task line on selection.
    • Dataview (dataview) — lists all Dataview-indexed pages with tags and aliases in description. Filterable by the picker's fuzzy matcher.
    • All three are gated by settings toggles in Settings → Vim Motions → Third-party integrations (default: enabled) and by runtime plugin detection via onLayoutReady.
    • Plugin: src/picker/sources/omnisearch.ts (new), src/picker/sources/tasks.ts (new), src/picker/sources/dataview.ts (new), src/main.ts (detection + registration), src/settings.ts (3 toggles)

Fixed

  • Obsidian line numbers leaking into table cell editors — when Obsidian's "Show line numbers" setting is enabled, line number gutters appeared inside embedded table cell editors where they shouldn't. Fixed by suppressing .cm-gutters in cell editors via CSS. (#19)
    • Plugin: styles.css

Changed

  • enableMarkGutter migrated to signcolumn — the boolean toggle is now a dropdown with Auto/Always/Off modes matching Neovim's signcolumn option. Existing settings are auto-migrated. set markgutter / set nomarkgutter remain as backward-compatible aliases.
  • Mark gutter internals refactored — the mark gutter implementation has been extracted into a dedicated sign-column.ts module. The rendering approach is unchanged (line decorations + CSS ::after overlay, zero layout shift), but the internal architecture now cleanly separates the sign column field from the refresh scheduling API. No user-facing changes.
    • Plugin: src/vim/sign-column.ts (new), src/vim/mark-gutter.ts (refactored to delegate)

Documentation

  • docs/configuration/settings.md: added numberwidth, cursorline, cursorlineopt, signcolumn, and foldcolumn settings
  • docs/configuration/vimrc.md: added new gutter options and markgutter alias to options tables
  • docs/configuration/lua-config.md: added new gutter options to vim.opt table
  • docs/features/marks.md: updated to mention signcolumn as the canonical way to toggle mark indicators
  • KNOWN_LIMITATIONS.md: added notes on signcolumn overlay behavior and cursorlineopt=screenline support
  • docs/configuration/settings.md: added Line numbers settings group
  • docs/configuration/vimrc.md: added number/nu, relativenumber/rnu to boolean options table
  • docs/configuration/lua-config.md: added vim.opt.number, vim.opt.relativenumber with hybrid mode tip
  • KNOWN_LIMITATIONS.md: removed number and relativenumber from "not implemented" options list
  • docs/development/picker-api.md: new provider API reference with consumer guide, API surface, integration examples (Omnisearch, Tasks), and lifecycle documentation
  • docs/development/index.md: added picker provider API link
  • docs/reference/keybindings.md: added :Picker / :Pick to ex commands table
  • KNOWN_LIMITATIONS.md: added picker provider API pop-out window limitation
  • docs/configuration/settings.md: added Third-party integrations settings group
  • docs/development/picker-api.md: added bundled integrations section
  • eslint.config.mts: added .obsidian-cache to global ignores (downloaded community plugin JS files)
  • wdio.conf.mts: added Omnisearch, Tasks, Dataview as enabled: false plugins for integration testing
  • test/specs/picker-integration.e2e.ts: 12 e2e tests covering source registration, picker opening, search results, meta-picker listing, and plugin disable/enable lifecycle

Full Changelog: 0.51.1...0.52.0

Don't miss a new motions release

NewReleases is sending notifications on new releases.