dev: NUWIKI_DEV_VIMWIKI mode to dogfood the g:vimwiki_* drop-in
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:
@@ -24,6 +24,7 @@
|
||||
# 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_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 running LSP. `cargo build --release` is incremental, so this is a fast
|
||||
@@ -86,6 +87,29 @@ EOF
|
||||
|
||||
write_vimrc() {
|
||||
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
|
||||
" start-vim-coc.sh: generated minimal config for nuwiki development (coc.nvim).
|
||||
" 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: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_diary_rel_path = 'diary'
|
||||
let g:nuwiki_log_level = 'info'
|
||||
" nuwiki auto-registers itself with coc from these globals (no coc-settings.json
|
||||
" languageserver block). 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 = ' -'
|
||||
" languageserver block).
|
||||
${WIKI_CFG}
|
||||
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
|
||||
Reference in New Issue
Block a user