Added
- Fold viewport scroll compensation — the viewport automatically scrolls to keep the cursor visible after any fold/unfold operation, including Obsidian's "Toggle fold properties" command. Uses a
TransactionExtenderfor CM6 fold effects and aMutationObserverfor the properties widget's CSS class toggle. (#54)- Plugin:
src/vim/fold-sync.ts(new),src/main.ts
- Plugin:
- Fold create/delete commands —
zf{motion}creates a manual fold over the motion range (works in both visual and operator-pending mode).zd/zDdelete the fold at the cursor.zEeliminates all folds in the document.- Ex commands:
:folddelete(zd),:foldeliminate(zE) - Plugin:
src/fold/commands.ts(new),src/operators/register.ts
- Ex commands:
- Incremental fold level —
zmfolds one more heading level (h1 first, then h2, etc.).zrunfolds one heading level. A customStateFieldtracks the current fold depth (0–6).- Ex commands:
:foldmore(zm),:foldless(zr) - Plugin:
src/fold/fold-level.ts(new),src/workspace/navigation.ts,src/main.ts
- Ex commands:
- Markdown fold provider — custom
foldServiceregisters frontmatter (---blocks) and callouts (> [!type]) as foldable regions. These are now foldable viazc/zo/zain addition to the standard CM6 heading and code block folds.- Plugin:
src/fold/provider.ts(new),src/main.ts
- Plugin:
- Fold placeholder text — folded regions show descriptive placeholder text: heading title + line count, code block language, callout type, or frontmatter field count. Uses
codeFolding({ preparePlaceholder, placeholderDOM }).- Plugin:
src/fold/placeholder.ts(new),src/main.ts
- Plugin:
- Fold-aware navigation — when enabled, navigating into a folded section (e.g.,
]hto a folded heading) automatically unfolds it. Matches Neovim's defaultfoldopenbehavior. Configurable via Settings → Vim Motions → Fold-aware navigation (default: on).- Plugin:
src/vim/fold-sync.ts,src/settings.ts
- Plugin:
- Fold persistence — fold state is remembered across file switches and sessions. Folds are captured on leaf change and restored when re-opening a file. Capped at 500 files with 30-day TTL eviction. Cleans up on file rename/delete.
- Plugin:
src/fold/persistence.ts(new),src/main.ts,src/settings.ts
- Plugin:
Documentation
docs/features/workspace-navigation.md: added fold provider, placeholder, fold-aware navigation, and persistence documentationdocs/reference/keybindings.md: addedzf,zd,zD,zE,zm,zrkeybindingsdocs/features/ex-commands.md: added:folddelete,:foldeliminate,:foldmore,:foldlessdocs/configuration/settings.md: added Fold-aware navigation and Fold persistence settingsKNOWN_LIMITATIONS.md: addedzn/zNas known deviations; updated fold command coveragetest/neovim-command-index.yaml: added 6 new fold command entries
Full Changelog: 0.49.0...0.50.0