feat(calendar): integrate calendar-vim with wiki diary paths
CI / cargo fmt --check (push) Successful in 34s
CI / cargo clippy (push) Successful in 43s
CI / cargo test (push) Successful in 41s
CI / editor keymaps (push) Successful in 1m29s

Wire g:calendar_action/g:calendar_sign to nuwiki diary hooks that
resolve diary paths from the wiki root config instead of calendar-vim's
default ~/diary. Auto-detected on FileType vimwiki when calendar-vim is
present; opt out with g:nuwiki_use_calendar=0 or g:nuwiki_no_calendar.

- autoload/nuwiki/diary.vim: calendar_action/calendar_sign using wiki cfg;
  open diary in the previous window and close the calendar window after.
- autoload/vimwiki/diary.vim: vimwiki# aliases for drop-in compatibility.
- plugin/nuwiki.vim + lua/nuwiki/init.lua: auto-wire hooks, overwriting
  calendar-vim's defaults while respecting user-set custom hooks.
- lua/nuwiki/config.lua: add use_calendar option (on by default).
- development/start-*.sh + _common.sh: clone calendar-vim, fix vimrc var
  expansion, pass wiki root to the Vim/Neovim clients.
This commit is contained in:
2026-05-31 21:34:41 -03:00
parent 39692ba99f
commit 7a3e11cfeb
9 changed files with 211 additions and 36 deletions
+7 -10
View File
@@ -54,17 +54,13 @@ vim.env.XDG_DATA_HOME = '$DATA_DIR'
vim.env.XDG_CONFIG_HOME = '$CONFIG_DIR'
vim.opt.runtimepath:prepend('$REPO_ROOT')
vim.opt.runtimepath:append('$DEV_DIR/calendar-vim')
vim.g.nuwiki_binary_path = '$REPO_ROOT/bin/nuwiki-ls'
-- Friendly defaults for an interactive smoke test.
vim.opt.number = true
vim.opt.signcolumn = 'yes'
vim.opt.termguicolors = true
vim.opt.swapfile = false
vim.opt.writebackup = false
vim.opt.undofile = false
vim.g.mapleader = ' '
vim.g.nuwiki_wiki_root = '$WIKI_DIR'
vim.g.nuwiki_file_extension = '.wiki'
vim.g.nuwiki_syntax = 'vimwiki'
vim.g.nuwiki_diary_rel_path = 'diary'
require('nuwiki').setup({
wiki_root = '$WIKI_DIR',
@@ -74,13 +70,14 @@ require('nuwiki').setup({
-- they're swallowed; with it they land in :messages.
vim.lsp.set_log_level('info')
print('[nuwiki-dev] ready — wiki root: $WIKI_DIR')
print('[nuwiki-dev] ready — wiki root: ' .. '$WIKI_DIR')
print('[nuwiki-dev] :LspInfo to inspect, :checkhealth nuwiki for diagnostics')
EOF
}
main() {
ensure_binary
ensure_calendar_vim
seed_wiki
write_init
reset_dirs "$STATE_DIR" "$DATA_DIR" "$CONFIG_DIR"