docs(calendar): fix stale comments and integration docs
- diary.vim: correct calendar_action doc comment (dir is used for split direction; only week is unused) - calendar-vim-integration.md: use real nuwiki var names (g:nuwiki_use_calendar / g:nuwiki_no_calendar / g:nuwiki_wikis), document auto-detect wiring and calendar-window close behavior; drop the non-existent refresh-on-close autocmd - vimwiki-gap.md: remove stale 'no calendar.vim integration' entry now that the integration is implemented
This commit is contained in:
@@ -5,7 +5,8 @@
|
|||||||
|
|
||||||
" Function: nuwiki#diary#calendar_action(day, month, year, week, dir)
|
" Function: nuwiki#diary#calendar_action(day, month, year, week, dir)
|
||||||
" Called by calendar-vim when user presses Enter on a date.
|
" Called by calendar-vim when user presses Enter on a date.
|
||||||
" day/month/year are numeric integers. week and dir are not used.
|
" day/month/year are numeric integers; dir is 'V' for a vertical split (any
|
||||||
|
" other value means a horizontal split). week is unused.
|
||||||
" Opens or creates the diary entry for the given date.
|
" Opens or creates the diary entry for the given date.
|
||||||
function! nuwiki#diary#calendar_action(day, month, year, week, dir) abort
|
function! nuwiki#diary#calendar_action(day, month, year, week, dir) abort
|
||||||
" Build YYYY-MM-DD from the parts passed by calendar-vim
|
" Build YYYY-MM-DD from the parts passed by calendar-vim
|
||||||
|
|||||||
@@ -4,10 +4,15 @@
|
|||||||
This document describes how nuwiki (vimwiki) integrates with calendar-vim to provide graphical calendar navigation for wiki diary entries.
|
This document describes how nuwiki (vimwiki) integrates with calendar-vim to provide graphical calendar navigation for wiki diary entries.
|
||||||
|
|
||||||
## Integration Mechanism
|
## Integration Mechanism
|
||||||
Nuwiki activates the integration by setting calendar-vim's hook variables when `g:vimwiki_use_calendar` is enabled (default: true):
|
Nuwiki auto-detects calendar-vim on the runtimepath (via a `FileType vimwiki`
|
||||||
|
autocmd in `plugin/nuwiki.vim`) and wires calendar-vim's hook variables, unless
|
||||||
|
the integration is disabled (default: enabled):
|
||||||
- `g:calendar_action = 'vimwiki#diary#calendar_action'`
|
- `g:calendar_action = 'vimwiki#diary#calendar_action'`
|
||||||
- `g:calendar_sign = 'vimwiki#diary#calendar_sign'`
|
- `g:calendar_sign = 'vimwiki#diary#calendar_sign'`
|
||||||
|
|
||||||
|
These hooks are only set when unset or still at calendar-vim's own defaults
|
||||||
|
(`calendar#diary` / `calendar#sign`), so a user-chosen custom hook is preserved.
|
||||||
|
|
||||||
## Primary Use Case: Viewing/Create Diary Entries
|
## Primary Use Case: Viewing/Create Diary Entries
|
||||||
1. User executes `:Calendar` command
|
1. User executes `:Calendar` command
|
||||||
2. Calendar-vim displays navigable calendar interface
|
2. Calendar-vim displays navigable calendar interface
|
||||||
@@ -15,9 +20,9 @@ Nuwiki activates the integration by setting calendar-vim's hook variables when `
|
|||||||
4. User presses `<Enter>` on selected date
|
4. User presses `<Enter>` on selected date
|
||||||
5. `vimwiki#diary#calendar_action` function executes:
|
5. `vimwiki#diary#calendar_action` function executes:
|
||||||
- Formats date as YYYY-MM-DD
|
- Formats date as YYYY-MM-DD
|
||||||
- Opens existing diary file or creates new one
|
- Opens existing diary file or creates new one (split/vsplit per `dir`)
|
||||||
- Applies appropriate wiki filetype
|
- Applies the vimwiki filetype to a brand-new entry
|
||||||
- Sets up autocmd to refresh calendar on file close
|
- Closes the calendar window once the diary entry is open
|
||||||
6. User views/edits diary entry for selected date
|
6. User views/edits diary entry for selected date
|
||||||
|
|
||||||
## Date Marking Functionality
|
## Date Marking Functionality
|
||||||
@@ -30,12 +35,15 @@ Nuwiki activates the integration by setting calendar-vim's hook variables when `
|
|||||||
- Automatic file creation/opening for selected dates
|
- Automatic file creation/opening for selected dates
|
||||||
- Visual indicators for dates with existing content
|
- Visual indicators for dates with existing content
|
||||||
- Proper window splitting based on calendar orientation
|
- Proper window splitting based on calendar orientation
|
||||||
- Automatic calendar refresh after editing diary entries
|
- Calendar window closed automatically once the diary entry opens
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
Controlled by:
|
Controlled by:
|
||||||
- `g:vimwiki_use_calendar` (global toggle)
|
- `use_calendar` Lua option (Neovim `setup()`), default `true`
|
||||||
- Individual wiki configurations in `g:vimwiki_list` (path, diary_rel_path, ext)
|
- `g:nuwiki_use_calendar` / `g:nuwiki_no_calendar` (VimL global toggles)
|
||||||
|
- Individual wiki configurations in `g:nuwiki_wikis` (root, diary_rel_path,
|
||||||
|
file_extension), or the scalar `g:nuwiki_wiki_root` / `g:nuwiki_diary_rel_path`
|
||||||
|
/ `g:nuwiki_file_extension` fallbacks
|
||||||
- Standard calendar-vim variables for appearance/customization
|
- Standard calendar-vim variables for appearance/customization
|
||||||
|
|
||||||
This integration leverages calendar-vim's strong date presentation while using nuwiki's diary system for file management, creating a cohesive experience for journal-style wiki usage.
|
This integration leverages calendar-vim's strong date presentation while using nuwiki's diary system for file management, creating a cohesive experience for journal-style wiki usage.
|
||||||
@@ -179,7 +179,6 @@ audits don't re-flag them.
|
|||||||
backed by LSP foldingRange.
|
backed by LSP foldingRange.
|
||||||
- `key_mappings` (dict) — replaced by Lua `mappings.<group>` + the
|
- `key_mappings` (dict) — replaced by Lua `mappings.<group>` + the
|
||||||
`g:nuwiki_no_<group>_mappings` globals.
|
`g:nuwiki_no_<group>_mappings` globals.
|
||||||
- `use_calendar` — no calendar.vim integration.
|
|
||||||
- `CJK_length`, `listing_hl*`, `schemes_*`, `w32_dir_enc`, `menu`,
|
- `CJK_length`, `listing_hl*`, `schemes_*`, `w32_dir_enc`, `menu`,
|
||||||
`rx_todo` / `tag_format` — syntax internals, menu, or Vim/Win shims.
|
`rx_todo` / `tag_format` — syntax internals, menu, or Vim/Win shims.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user