Added
- Vim toggle commands — three new Obsidian commands to toggle the plugin's vim mode on/off at runtime without reload:
toggle-vim-mode,enable-vim-mode, anddisable-vim-mode. Uses a mutable extension array for zero-latency switching. (#153)- Plugin:
src/main.ts(mutable extension array, toggle methods, Obsidian commands,vimEnabledguards) - Plugin:
src/settings.ts(newvimEnabledsetting in General page) - Fork:
~/Repos/codemirror-vim/src/index.ts(exportedresetForkedVimState()) - Fork:
~/Repos/codemirror-vim/src/block-cursor.ts(exportedresetCursorState())
- Plugin:
- Lua ex command cleanup — track and remove Lua-defined ex commands during toggle or reload.
- Plugin:
src/lua/loader.ts(ex command name tracking)
- Plugin:
Changed
- Vim subsystem lifecycle — extracted
setupVimSubsystems()andteardownVimSubsystems()for clean runtime toggling.- Plugin:
src/main.ts(lifecycle extraction)
- Plugin:
- Bundled vim state reset —
bundledActiveis now resettable to support runtime re-initialization.- Plugin:
src/vim/bundled-vim.ts(resettable state)
- Plugin:
Fixed
- Native cursor visibility after vim toggle —
BlockCursorPlugin.destroy()now correctly restores nativecaret-colorand cursor layer display, preventing an invisible cursor when vim is disabled.- Fork:
~/Repos/codemirror-vim/src/block-cursor.ts(restore logic indestroy())
- Fork:
this.register()accumulation — fixed a bug wherereloadFeatures()would accumulate listeners on every call.- Plugin:
src/main.ts(cleanup logic)
- Plugin:
Tests
- Vim toggle e2e suite — 27 new tests covering full toggle lifecycle, idempotent commands, edge cases (insert/visual mode, debounce), persistence, and bridge availability.
- Test:
test/specs/vim-toggle.e2e.ts(17 tests) - Test:
test/specs/vim-toggle-resilience.e2e.ts(10 tests)
- Test:
- Mutable array spike — validated the
updateOptions()mechanism for runtime extension swapping.- Test:
test/specs/spikes/spike-mutable-array-destroy.e2e.ts(3 tests)
- Test:
- Regression detection — added a
beforeSuitehook towdio.conf.mtsthat cycles vim mode before every spec.- Test:
wdio.conf.mts(toggle-cycle hook)
- Test:
Documentation
CHANGELOG.mdAGENTS.md: updated fork API surface withresetForkedVimState,resetCursorState,BlockCursorPlugin.destroy()cursor restoration; documented vim toggle capability in dual-vim architecture; addedbeforeSuitetoggle-cycle hook and new test files to test infrastructure section; addedvimEnabledto settings documentationCONTRIBUTING.md: documentedsetupVimSubsystems()/teardownVimSubsystems()extraction pattern and mutable extension array mechanismREADME.md: added vim toggle commands to Quality of life featuresdocs/configuration/settings.md: addedvimEnabledsetting to General pagedocs/reference/keybindings.md: added Obsidian commands section withtoggle-vim-mode,enable-vim-mode,disable-vim-mode- Fork:
~/Repos/codemirror-vim/DIFFERENCES.md: documentedresetForkedVimStateAPI,resetCursorStateAPI, andBlockCursorPlugin.destroy()cursor restoration fix
Full Changelog: 0.134.0...0.135.0