Merge remote-tracking branch 'origin/calendar-support' into feature-gap
CI / cargo fmt --check (push) Successful in 35s
CI / cargo clippy (push) Successful in 32s
CI / cargo test (push) Successful in 39s
CI / editor keymaps (push) Successful in 1m32s

# Conflicts:
#	development/vimwiki-gap.md
This commit is contained in:
2026-06-03 01:46:07 +00:00
18 changed files with 682 additions and 45 deletions
+24
View File
@@ -33,6 +33,30 @@ else
command! -nargs=0 NuwikiInstall execute 'source' fnameescape(s:plugin_root . '/scripts/download_bin.vim')
endif
" Calendar-Vim Integration — auto-detect when calendar-vim is loaded.
augroup nuwiki_calendar_detect
autocmd!
autocmd FileType vimwiki call s:nuwiki_setup_calendar()
augroup END
function! s:nuwiki_setup_calendar() abort
if !get(g:, 'nuwiki_use_calendar', 1) || get(g:, 'nuwiki_no_calendar', 0)
return
endif
if exists('*calendar#open') || exists(':Calendar') == 2
" Wire nuwiki's diary hooks unless the user set a custom (non-default) one.
" calendar-vim's own default is 'calendar#diary' (writes to ~/diary); we
" overwrite that so paths come from the wiki root config instead.
let l:act = get(g:, 'calendar_action', '')
if l:act ==# '' || l:act ==# 'calendar#diary'
let g:calendar_action = 'vimwiki#diary#calendar_action'
endif
let l:sign = get(g:, 'calendar_sign', '')
if l:sign ==# '' || l:sign ==# 'calendar#sign'
let g:calendar_sign = 'vimwiki#diary#calendar_sign'
endif
endif
endfunction
if has('nvim')
" Neovim path is initialised by `require('nuwiki').setup()`. Nothing else
" to do at vimscript boot — wait until the user runs setup.