Added
- Fold navigation motions (
zj,zk,[z,]z) —zjmoves to the start of the next foldable region (skipping child folds within the current heading's range, matching Neovim's sibling-fold semantics).zkmoves to the end of the previous foldable region.[z/]znavigate to the start/end of the enclosing foldable region. All four support counts (3zj), operator-pending mode (dzj), and record to the jump list. Ex command aliases::foldnext,:foldprev,:foldstart,:foldend.- Plugin:
src/fold/motions.ts(NEW —findNextFoldable,findPrevFoldable,findEnclosingFoldable,foldedRangesWithin,foldableRegionsWithin,foldNext,foldPrev,foldStart,foldEnd) - Plugin:
src/fold/commands.ts(registered motions + ex commands)
- Plugin:
- Fold state commands (
zn,zN,zi,zv,zF,zx,zX) —zndisables folding (opens all folds, prevents new folds).zNre-enables folding.zitoggles.zvopens folds to reveal cursor line.zFcreates a fold for [count] lines.zx/zXreapply fold level (preserving manual folds). Configure viaset foldenable/set nofoldenablein vimrc orvim.opt.foldenablein Lua.- Plugin:
src/fold/fold-enable.ts(NEW —foldEnableFieldStateField,isFoldingEnabledguard,zn/zN/ziactions) - Plugin:
src/fold/commands.ts(zv,zFactions) - Plugin:
src/fold/fold-level.ts(zx,zXactions) - Plugin:
src/vim/options.ts(foldenablevim option)
- Plugin:
- Heading fold provider with trailing blank line trimming — custom
foldServiceprovider for Markdown headings that trims trailing blank lines from fold ranges, matching Neovim's treesitter fold boundaries. Overrides Obsidian's built-infoldNodeProp-based heading folds.- Plugin:
src/fold/provider.ts(headingFoldfunction added tomarkdownFoldProvider)
- Plugin:
Changed
- Recursive fold operations (
zO,zC,zA,zD) — uppercase fold commands now operate recursively on all folds within the cursor's foldable region using range containment. Previously mapped identically to lowercase variants.- Plugin:
src/workspace/navigation.ts(foldOpenRecursiveAction,foldCloseRecursiveAction,foldToggleRecursiveAction) - Plugin:
src/fold/commands.ts(foldDeleteRecursiveAction)
- Plugin:
- Fold-enable guards — fold-creating/closing actions (
zc,za,zM,zm,zf,zF) respect thefoldenablestate. Unfold operations (zo,zR,zr,zv) always work regardless offoldenable.- Plugin:
src/fold/commands.ts,src/workspace/navigation.ts,src/fold/fold-level.ts
- Plugin:
Tests
- 12 Neovim golden test definitions for fold motions in
test/neovim/test-definitions.ts(fold-motionssuite with treesitter fold setup) - 16 E2E tests in
test/specs/vim-builtin/fold-motions.e2e.ts: 12 golden comparison tests + 4 plugin-specific tests (operator-pendingdzj/dzk, no-op without foldable regions) - 3 known deviations registered in
test/neovim/deviations.ts:zkcount (treesitter fold hierarchy),[z/]z(fold body vs heading boundary)
Documentation
CHANGELOG.mdKNOWN_LIMITATIONS.md: UpdatedzO/zC/zAandzn/zNrows as fixed; updated golden test coverage table with new fold commandsCONTRIBUTING.md: Updatedsrc/fold/structure with new filesREADME.md: Updated Folding feature descriptiondocs/reference/keybindings.md: Added Fold commands sectiondocs/features/workspace-navigation.md: Added Fold motions, Fold state, Recursive fold sectionsdocs/configuration/settings.md: Addedfoldenableoption
Full Changelog: 0.114.0...0.115.0