github saberzero1/motions 0.8.0

latest releases: 1.0.1, 1.0.0, 0.150.0...
3 months ago

0.8.0 - 2026-06-23

Added

  • Vim chord display — pending keystrokes (e.g. 2d, gq, <C-w>h) are shown in the status bar as you type a multi-key command, clearing when the command completes or is cancelled. Reads codemirror-vim's internal vim.status string directly, avoiding event-ordering issues with manual keystroke accumulation in the CM6 adapter. Togglable via Settings → Vim Motions → Vim chord display (on by default). (#2)
  • Customizable mode prompts — per-mode status bar text is configurable via four text fields in Settings → Vim Motions → Vim mode display prompt (normal, insert, visual, replace). Defaults to NORMAL/INSERT/VISUAL/REPLACE. Supports emoji (e.g. 🟢 for normal). (#3)
  • Powerline-style status bar — optional colored mode indicator with per-mode background colors (gruvbox-inspired: green/normal, teal/insert, amber/visual, red/replace) and a CSS border-triangle separator. No special font required — uses pure CSS. Togglable via Settings → Vim Motions → Powerline-style status bar (off by default). Colors are overridable via CSS custom properties (--vim-pl-normal-bg, --vim-pl-normal-fg, etc.).
  • Left-aligned status bar — the vim mode indicator and chord display are always positioned at the leftmost edge of the status bar via DOM reordering and margin-right: auto, matching the convention established by obsidian-vimrc-support.
  • ModePrompts interface and DEFAULT_MODE_PROMPTS constant exported from settings.ts.
  • VimModeTrackerOptions extended with powerline and modePrompts fields.
  • CSS classes: vim-motions-chord, vim-motions-powerline, vim-motions-statusbar-end.
  • Hint mode expanded into a full vimium-style UI navigation system (#7):
    • Smart label length: single-character labels (from home row) when 9 or fewer targets, two-character labels for more.
    • Configurable hint characters: new hintModeLabels setting controls the character pool for hint labels (default: asdfghjkl).
    • Independent settings toggle: enableHintMode setting allows toggling hint mode on/off independently from workspace navigation.
    • Obsidian command: registered as vim-motions:show-hint-labels — triggerable from command palette, assignable via Settings → Hotkeys, and usable without an open note.
    • Global hotkey: press-to-record hotkey setting that works even when modals (settings, command palette) have focus. Uses capture-phase DOM listeners that bypass Obsidian's scope system.
    • Multi-window support: global hotkey listener registered on workspace popout windows via window-open event.
    • Editor pane navigation: .workspace-leaf-content is now a hint target. Selecting it calls setActiveLeaf() with focus and activates the editor, matching click-to-focus behavior.
    • Smarter element activation: contenteditable elements receive .focus(), internal links use app.workspace.openLinkText(), Ctrl/Cmd+click opens in new pane via MouseEvent dispatch.
    • Backspace reset: pressing Backspace after typing a wrong first character undims all labels and allows re-selection.
    • First-char mismatch dismissal: pressing a character that matches no label immediately dismisses the overlay instead of waiting for a second character.
    • Auto refocus: after hint mode completes, the active editor is refocused (150ms delay) so <leader><leader>h works for the next invocation.
  • Hint mode target selectors expanded from 9 to 24, covering: checkboxes, ribbon icons, callout folds, settings navigation items, settings controls (buttons, toggles, dropdowns), tab close buttons, search inputs, editor panes, internal links in live preview, and modal close buttons.
  • Selectors grouped by stability: standard HTML selectors (stable across Obsidian versions) and Obsidian-internal selectors (may change between versions).
  • generateHintLabels(), HOME_ROW, ALL_KEYS, and TARGET_SELECTOR exported from hint-mode.ts for testability.
  • E2E test suite test/specs/hint-mode.e2e.ts with 13 tests across two tiers:
    • Tier 1 (baseline): overlay appearance, label rendering, Escape dismissal, first-char dimming, label completion, unmatched-char dismissal, Backspace reset.
    • Tier 2 (behavior contracts): home-row first characters, no duplicate labels, consistent label length, visibility filtering, pointer-events CSS, Obsidian command registration.
  • formatHotkey() utility in settings.ts for displaying serialized hotkey strings in human-readable form.
  • CSS class .vim-motions-hotkey-display for the hotkey display in settings.

Changed

  • Hint mode registration extracted from registerWorkspaceNavigation() into a standalone registerHintMode() private method on the plugin, following the same pattern as registerEasyMotion().
  • createHintModeAction() now accepts an optional hintChars parameter for configurable hint character pools.
  • isVisible() now checks against scrollable ancestor containers (not just the viewport) — elements scrolled out of view inside overflow: hidden/scroll/auto parents are excluded.
  • showHints() refactored to use getHintPosition() which places .workspace-leaf-content labels at the editor/preview content area (8px inset) rather than the top-left of the leaf container.
  • waitForHintKey() now returns HintResult with ctrlKey/metaKey modifier state for new-pane activation support.
  • activateElement() replaces the previous bare .click() with context-aware activation (focus, link resolution, modifier-based new-pane, setActiveLeaf).
  • Pop-out window compatibility: window.innerHeight/scrollX/scrollY replaced with activeWindow.* equivalents throughout hint mode.
  • Hotkey recorder uses e.code as fallback when e.key reports 'Unidentified' (common for Ctrl+Space on Linux with input methods).

Fixed

  • Hint mode now works when no note is open (via the Obsidian command path).
  • Hint mode global hotkey now fires even when a modal (settings, command palette) has focus — uses capture-phase keydown listeners on the main window's document that bypass Obsidian's scope system.
  • Selecting a .workspace-leaf-content hint now properly focuses the editor pane via app.workspace.setActiveLeaf() instead of a bare .click() that Obsidian didn't treat as a pane activation.
  • Settings controls (toggles, buttons, dropdowns, navigation items) are now targetable via hint mode.
  • Tab close buttons (.workspace-tab-header-inner-close-button) are now targetable via hint mode.
  • Elements inside scrollable containers (e.g., settings content area) that are scrolled out of view no longer receive hint labels.

Full Changelog: 0.7.0...0.8.0

Don't miss a new motions release

NewReleases is sending notifications on new releases.