-- lua/nuwiki/config.lua — defaults and user-config merge. -- -- Schema mirrors SPEC §7.5 + §12.11. Keep this aligned with -- `doc/nuwiki.txt`. local M = {} M.defaults = { -- v1.0 single-wiki shorthand. The server desugars these into a -- one-entry `wikis = {…}` list. Use either this or the multi-wiki -- form below; if both are set, `wikis` wins. wiki_root = '~/vimwiki', file_extension = '.wiki', syntax = 'vimwiki', log_level = 'warn', -- v1.1 multi-wiki shape. Each entry honours every per-wiki key the -- server understands. Leave nil to fall through to the shorthand -- above. -- -- Per-wiki keys (all optional, server defaults documented in SPEC -- §12.11): -- name, root, file_extension, syntax, index -- diary_rel_path, diary_index, diary_frequency, -- diary_start_week_day, diary_caption_level, diary_sort, -- diary_header -- html_path, template_path, template_default, template_ext, -- template_date_format, css_name, auto_export, auto_toc, -- html_filename_parameterization, exclude_files, color_dic -- maxhi, listsyms, listsyms_propagate, list_margin, -- links_space_char, nested_syntaxes wikis = nil, -- Phase 19: per-buffer glue. Each subgroup mirrors vimwiki's -- `g:vimwiki_key_mappings` shape and can be flipped off -- independently to suppress that group of keymaps. mappings = { enabled = true, wiki_prefix = true, -- w* links = true, -- , , , , +, … lists = true, -- , gln/glp/glx, gl, o/O, … headers = true, -- =, -, ]], [[, ]=, [=, ]u, [u table_editing = true, -- gqq, gq1, gww, gw1, , diary = true, -- , html_export = true, -- wh, whh text_objects = true, -- ah, ih, aH, iH, al, il, a\, i\, ac, ic mouse = false, -- <2-LeftMouse>, , … (opt-in) }, -- Phase 19: folding. `'lsp'` uses the server's `foldingRange` -- provider (Neovim 0.11+ wires it automatically). `'expr'` falls -- back to a regex-based `foldexpr`. `'off'` skips folding setup. folding = 'lsp', } M.options = vim.deepcopy(M.defaults) function M.apply(user) M.options = vim.tbl_deep_extend('force', M.defaults, user or {}) end return M