feat(config): vimwiki drop-in config + global per-wiki defaults
Two related config-ergonomics features for vimwiki migrants, sharing the
same scalar-global machinery.
1. Upstream g:vimwiki_* drop-in (Vim client). When nuwiki isn't configured
natively, the Vim client reads g:vimwiki_list + g:vimwiki_* globals and
translates them into nuwiki's schema: per-wiki path->root,
path_html->html_path, template_*, css_name, auto_export/auto_toc,
syntax, ext->file_extension, index, diary_*, name. g:nuwiki_* always
wins. Lets a vimwiki user drop in nuwiki without rewriting config.
2. Global per-wiki defaults (both clients). A display/generation setting
given once at the top level — g:nuwiki_<key> / setup({<key>=…}) /
g:vimwiki_<key> — is folded into every wiki as a default; a per-wiki
value overrides it (vimwiki's model). Covers toc_header(_level),
toc_link_format, links_header(_level), tags_header(_level),
html_header_numbering(_sym), links_space_char, list_margin, listsyms,
listsym_rejected, and the auto_* toggles. Only values the user
explicitly set fold — built-in defaults don't (added config.user
tracking on the Lua side so a default toc_header_level=1 isn't pushed
onto every wiki). User config tables are never mutated.
Both clients kept in lock-step (config-parity golden enforces identical
payloads). New harnesses test-vimwiki-compat-vim (18) and
test-global-shorthand (8), wired into CI. Server test
vimwiki_compat_payload_sets_toc_level_per_wiki. Docs in README +
known-issues.md (drop-in is currently Vim-only). Rust 573 passed, clippy
clean, all harnesses green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -128,6 +128,15 @@ correct as-is; the deferral is a deliberate risk/reward call.
|
||||
|
||||
## Notes
|
||||
|
||||
- **Upstream `g:vimwiki_list` config (Vim).** When you haven't configured
|
||||
nuwiki natively, the Vim client reads your upstream `g:vimwiki_list` +
|
||||
`g:vimwiki_*` globals and translates them into nuwiki's schema (per-wiki
|
||||
`path`/`path_html`/`template_*`/`auto_export`, plus globals `toc_header`,
|
||||
`toc_header_level`, `html_header_numbering`, `html_header_numbering_sym`,
|
||||
`links_space_char`, `list_margin`). `g:nuwiki_*` always wins. Globals nuwiki
|
||||
doesn't model (e.g. `automatic_nested_syntaxes`) are ignored — see the
|
||||
divergence list above. **Limitation:** this drop-in translation is currently
|
||||
**Vim-only**; on Neovim, configure via `setup()` / `g:nuwiki_wikis`.
|
||||
- **Third-party plugin compatibility.** A shim at `autoload/vimwiki/vars.vim`
|
||||
exposes the subset of `vimwiki#vars#get_wikilocal` that plugins like
|
||||
vimwiki-sync and vim-zettel call (`path`, `ext`/`extension`, `syntax`,
|
||||
|
||||
Reference in New Issue
Block a user