github saberzero1/motions 0.132.0

latest releases: 1.4.0, 1.3.1, 1.3.0...
one month ago

Added

  • Global config directory search — new globalConfigSearch setting (default off, desktop only) that auto-searches the Obsidian user data folder (~/.config/obsidian/ on Linux, ~/Library/Application Support/obsidian/ on macOS, %APPDATA%\obsidian\ on Windows) for config files after exhausting vault-root candidates. Vault-root files always take priority. Uses getObsidianUserDataDir() (Electron userData path) for platform-correct resolution. (#150)
    • Plugin: src/settings.ts (new globalConfigSearch setting, declarative + imperative UI, RELOAD_KEYS)
    • Plugin: src/lua/loader.ts (resolveLuaConfigPath global search step, LoadInitLuaOptions update)
    • Plugin: src/vimrc/loader.ts (resolveVimrcPath global search step, loadVimrc signature update)
    • Plugin: src/main.ts (passes globalConfigSearch to both loaders and softReloadVimrc)
  • g@{motion} operatorfunc support — new operator that calls a stored callback with the motion type ('line', 'char', or 'block'). Sets '[ and '] marks to the range covered by the motion. Public API includes setOperatorfunc(fn) and getOperatorfunc().
    • Fork: ~/Repos/codemirror-vim/src/vim.js (new operatorfunc operator, setOperatorfunc/getOperatorfunc API)
  • :move and :copy ex commands — proper implementation of line-move and line-copy commands. :move (:m) moves a range of lines to a destination address; :copy (:co, :t) copies them. Supports absolute, relative, and boundary addresses (0, $).
    • Fork: ~/Repos/codemirror-vim/src/vim.js (new :move and :copy ex command implementations)
    • Plugin: src/workspace/commands.ts (cursor positioning fix for :move)
  • Insert mode undo control — added <C-G>u to manually insert an undo break and <C-G>U to suppress the next automatic undo break on cursor movement.
    • Fork: ~/Repos/codemirror-vim/src/vim.js (new <C-G>u and <C-G>U actions)
  • Insert mode line navigation — added <C-G>j, <C-G>k, <C-G><C-J>, and <C-G><C-K> to navigate lines while preserving the insert-start column.
    • Fork: ~/Repos/codemirror-vim/src/vim.js (new insert-mode navigation actions)
  • Insert mode indent deletion — added 0<C-D> and ^<C-D> to delete all indentation on the current line.
    • Fork: ~/Repos/codemirror-vim/src/vim.js (new insert-mode indent actions)
  • Lua vim.o.operatorfunc bridge — wired operatorfunc through the Lua API. Users can assign a Lua function to vim.o.operatorfunc which will be called when g@ is used.
    • Plugin: src/lua/api.ts (Lua bridge for operatorfunc)
    • Plugin: src/types/vim-api.d.ts (updated VimApi type definition)

Changed

  • @: repeat last ex command — now pushes the command to history before execution and supports count prefixes (e.g., 2@: replays twice).
    • Fork: ~/Repos/codemirror-vim/src/vim.js (history push in handleEx, count support)
  • <C-y> and <C-e> cursor behavior — cursor now advances after copying a character from above or below, matching Neovim.
    • Fork: ~/Repos/codemirror-vim/src/vim.js (cursor advancement fix)
  • gR virtual replace at EOL — fixed boundary check to allow replacing the last character of a line.
    • Fork: ~/Repos/codemirror-vim/src/cm_adapter.ts (boundary check fix)
  • <C-a> re-insert previous insert — now correctly saves changes to previousInsertModeChanges before resetting, ensuring the previous insert is always available.
    • Fork: ~/Repos/codemirror-vim/src/vim.js (recording fix in recordLastEdit)
  • Command index overhaul — expanded coverage tracking from 337 to 427 commands. 90 new entries added, 15 commands reclassified as tested, and 4 deviations removed.
    • Test: test/neovim-command-index.yaml (90 new entries)
    • Test: test/neovim/deviations.ts (4 removed, 8 added)

Fixed

  • :move cursor positioning — cursor now correctly lands on the last moved line instead of the first.
    • Plugin: src/workspace/commands.ts (positioning fix)
  • @: e2e test assertion — strengthened assertion from toContain to toBe for more reliable verification.
    • Test: test/specs/vim-builtin/new-commands.e2e.ts (assertion fix)
  • Documentation: incorrect shared config directory instructions — the "Shared config across vaults" sections in lua-config.md and vimrc.md presented global paths like ~/.config/obsidian/init.lua as if they were auto-searched, but they only work when explicitly set as a custom path. Rewritten to document both the new global search toggle (Option A) and the custom absolute path (Option B). (#150)
  • Documentation: tablewidget default wrong in Lua config reference — documented default was "cursor", actual default is "native". Valid values corrected to "native", "raw".
  • Documentation: oilconfirmdeletethreshold default wrong — documented as 5 in lua-config.md and vimrc.md, actual default is 1 (from DEFAULT_SETTINGS).
  • Documentation: Oil vimrc/Lua option names wrong in settings reference — oilexplorer → oil, oilshowhiddenfiles → oilhiddenfiles, oildefaultsort → oilsort. Oil confirm delete threshold range corrected from 1–20 to 0–100.
  • Documentation: yank highlight duration range wrong — documented as 50–3000 ms in settings.md, actual range is 0–5000 ms.
  • Documentation: foldenable listed as Settings UI toggle — foldenable is a CM Vim built-in option registered via vim.defineOption, not a VimMotionsSettings property. Moved from Vim features table to "Vimrc / Lua only" section.

Tests

  • 68 new Neovim golden test cases — expanded coverage for gE, go, *, #, (, ), ]], [[, ][, [], dgn, cgn, visual mode operators, <C-r> redo, gR, gp, gP, Y, insert mode <C-r>, <C-c>, <C-G>u, <C-G>j/k, 0<C-D>, ^<C-D>, and Q.
    • Test: test/neovim/test-definitions.ts (68 new cases)
  • New golden spec file — test/specs/vim-builtin/new-commands-golden.e2e.ts adds 12 golden tests for @:, &, ]<Space>, [<Space>, and insert mode <C-y>, <C-e>, <C-a>.
    • Test: test/specs/vim-builtin/new-commands-golden.e2e.ts (new file)

Documentation

  • CHANGELOG.md
  • AGENTS.md: updated fork API and test infrastructure descriptions
  • CONTRIBUTING.md: updated file tree for new test file
  • KNOWN_LIMITATIONS.md: marked :move and :copy as implemented, updated infra-limitation deviations
  • README.md: added g@ and new ex commands to features list
  • docs/reference/keybindings.md: added new insert mode and editing commands
  • docs/features/ex-commands.md: added :move and :copy details
  • docs/configuration/lua-config.md: added vim.o.operatorfunc documentation, fixed shared config section, tablewidget default, oilconfirmdeletethreshold default
  • docs/configuration/vimrc.md: fixed shared config section, oilconfirmdeletethreshold default
  • docs/configuration/settings.md: fixed oil vimrc/Lua names, yank highlight duration range, moved foldenable to vimrc/Lua-only section, added globalConfigSearch setting
  • AGENTS.md: updated Lua configuration page ownership with globalConfigSearch

Full Changelog: 0.131.0...0.132.0

Don't miss a new motions release

NewReleases is sending notifications on new releases.