feat(calendar): integrate calendar-vim with wiki diary paths
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:
+12
-11
@@ -70,19 +70,20 @@ write_vimrc() {
|
||||
|
||||
" Confine state to the dev cache so we never touch the user's real Vim
|
||||
" install.
|
||||
set viminfo='100,n$VIM_STATE/viminfo
|
||||
let &directory = '$VIM_STATE/swap//'
|
||||
let &backupdir = '$VIM_STATE/backup//'
|
||||
let &undodir = '$VIM_STATE/undo//'
|
||||
set viminfo='100,n${VIM_STATE}/viminfo
|
||||
let &directory = '${VIM_STATE}/swap//'
|
||||
let &backupdir = '${VIM_STATE}/backup//'
|
||||
let &undodir = '${VIM_STATE}/undo//'
|
||||
|
||||
" Make Vim look for runtime paths in the dev cache.
|
||||
set nocompatible
|
||||
let &runtimepath = '$REPO_ROOT' . ',' . &runtimepath
|
||||
let &runtimepath .= ',$VIM_LSP_DIR'
|
||||
let &runtimepath .= ',$ASYNC_DIR'
|
||||
let &runtimepath = '${REPO_ROOT}' . ',' . &runtimepath
|
||||
let &runtimepath .= ',${VIM_LSP_DIR}'
|
||||
let &runtimepath .= ',${ASYNC_DIR}'
|
||||
let &runtimepath .= ',${DEV_DIR}/calendar-vim'
|
||||
|
||||
let g:nuwiki_binary_path = '$REPO_ROOT/bin/nuwiki-ls'
|
||||
let g:nuwiki_wiki_root = '$WIKI_DIR'
|
||||
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_log_level = 'info'
|
||||
@@ -113,8 +114,7 @@ augroup NuwikiStart
|
||||
autocmd FileType vimwiki call nuwiki#lsp#start()
|
||||
augroup END
|
||||
|
||||
" Status messages go to :messages so they don't trigger "Press ENTER".
|
||||
echomsg '[nuwiki-dev] ready — wiki root: $WIKI_DIR'
|
||||
echomsg '[nuwiki-dev] ready — wiki root: ' . g:nuwiki_wiki_root
|
||||
echomsg '[nuwiki-dev] :LspStatus for diagnostics, :messages for log'
|
||||
EOF
|
||||
}
|
||||
@@ -122,6 +122,7 @@ EOF
|
||||
main() {
|
||||
ensure_binary
|
||||
ensure_vim_lsp
|
||||
ensure_calendar_vim
|
||||
seed_wiki
|
||||
write_vimrc
|
||||
reset_dirs "$VIM_STATE"
|
||||
|
||||
Reference in New Issue
Block a user