dev: NUWIKI_DEV_VIMWIKI mode to dogfood the g:vimwiki_* drop-in
CI / cargo fmt --check (push) Successful in 25s
CI / cargo clippy (push) Successful in 30s
CI / cargo test (push) Successful in 38s
CI / editor keymaps (push) Successful in 1m31s

The start-vim-coc.sh harness runs `vim --clean`, so it never sources a
user's real vimwiki.vim — meaning g:vimwiki_list is never set and the
g:vimwiki_* drop-in translation was impossible to exercise through the
harness (you'd only ever test the native g:nuwiki_* path).

Add NUWIKI_DEV_VIMWIKI=1: instead of g:nuwiki_*, the generated vimrc
configures an upstream g:vimwiki_list (+ g:vimwiki_toc_header_level etc.)
pointing at the scratch wiki, so nuwiki's client-side translation +
programmatic coc registration run on a real vimwiki-shaped config.

    NUWIKI_DEV_VIMWIKI=1 ./development/start-vim-coc.sh

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 00:26:11 +00:00
parent ac14cdd838
commit 346e8b0de6
+26 -8
View File
@@ -24,6 +24,7 @@
# NUWIKI_DEV_NO_SEED=1 ./development/start-vim-coc.sh # use WIKI_DIR as-is (no scratch seeding) # NUWIKI_DEV_NO_SEED=1 ./development/start-vim-coc.sh # use WIKI_DIR as-is (no scratch seeding)
# NUWIKI_DEV_SKIP_BUILD=1 ./development/start-vim-coc.sh # reuse the cached binary # NUWIKI_DEV_SKIP_BUILD=1 ./development/start-vim-coc.sh # reuse the cached binary
# NUWIKI_DEV_COC_JUMP=edit ./development/start-vim-coc.sh # change coc.preferences.jumpCommand # NUWIKI_DEV_COC_JUMP=edit ./development/start-vim-coc.sh # change coc.preferences.jumpCommand
# NUWIKI_DEV_VIMWIKI=1 ./development/start-vim-coc.sh # drive nuwiki from a g:vimwiki_list config (drop-in)
# #
# The release binary is rebuilt on every launch so source changes always reach # The release binary is rebuilt on every launch so source changes always reach
# the running LSP. `cargo build --release` is incremental, so this is a fast # the running LSP. `cargo build --release` is incremental, so this is a fast
@@ -86,6 +87,29 @@ EOF
write_vimrc() { write_vimrc() {
mkdir -p "$DEV_DIR" mkdir -p "$DEV_DIR"
# Wiki config block. Default: native g:nuwiki_* (single wiki). With
# NUWIKI_DEV_VIMWIKI=1: an upstream g:vimwiki_list config instead, to dogfood
# the g:vimwiki_* drop-in translation (the path real vimwiki migrants use).
local WIKI_CFG
if [[ "${NUWIKI_DEV_VIMWIKI:-0}" == "1" ]]; then
log "NUWIKI_DEV_VIMWIKI=1 — driving nuwiki from an upstream g:vimwiki_list config"
WIKI_CFG="\" Upstream vimwiki config (drop-in). nuwiki translates these.
let g:vimwiki_toc_header_level = 2
let g:vimwiki_html_header_numbering = 2
let g:vimwiki_html_header_numbering_sym = ' -'
let g:vimwiki_list = [{'path': '${WIKI_DIR}', 'path_html': '${DEV_DIR}/html', 'ext': '.wiki'}]"
else
WIKI_CFG="let g:nuwiki_wiki_root = '${WIKI_DIR}'
let g:nuwiki_file_extension = '.wiki'
let g:nuwiki_diary_rel_path = 'diary'
\" Display settings exercise the global shorthand: :NuwikiTOC writes
\" \`== Contents ==\` (level 2) and HTML export numbers headings.
let g:nuwiki_toc_header_level = 2
let g:nuwiki_html_header_numbering = 2
let g:nuwiki_html_header_numbering_sym = ' -'"
fi
cat > "$VIMRC" <<EOF cat > "$VIMRC" <<EOF
" start-vim-coc.sh: generated minimal config for nuwiki development (coc.nvim). " start-vim-coc.sh: generated minimal config for nuwiki development (coc.nvim).
" Regenerated on every launch; edit start-vim-coc.sh, not this file. " Regenerated on every launch; edit start-vim-coc.sh, not this file.
@@ -109,17 +133,11 @@ let g:coc_config_home = '${DEV_DIR}'
let g:coc_data_home = '${COC_DATA}' let g:coc_data_home = '${COC_DATA}'
let g:nuwiki_binary_path = '${REPO_ROOT}/bin/nuwiki-ls' let g:nuwiki_binary_path = '${REPO_ROOT}/bin/nuwiki-ls'
let g:nuwiki_wiki_root = '${WIKI_DIR}'
let g:nuwiki_file_extension = '.wiki'
let g:nuwiki_syntax = 'vimwiki' let g:nuwiki_syntax = 'vimwiki'
let g:nuwiki_diary_rel_path = 'diary'
let g:nuwiki_log_level = 'info' let g:nuwiki_log_level = 'info'
" nuwiki auto-registers itself with coc from these globals (no coc-settings.json " nuwiki auto-registers itself with coc from these globals (no coc-settings.json
" languageserver block). Display settings exercise the global shorthand: " languageserver block).
" :NuwikiTOC writes `== Contents ==` (level 2) and HTML export numbers headings. ${WIKI_CFG}
let g:nuwiki_toc_header_level = 2
let g:nuwiki_html_header_numbering = 2
let g:nuwiki_html_header_numbering_sym = ' -'
filetype plugin indent on filetype plugin indent on
syntax enable syntax enable