Problem: need to reconcile buffer edits against the JSON store
on :w, handling creates, deletes, updates, reorders, and
duplicate IDs from yank/paste.
Solution: add diff module that parses buffer lines, matches
against stored tasks by ID, creates new tasks for unknown or
duplicate IDs, marks removed tasks as deleted, and updates
changed fields.
Problem: need a buffer to display tasks with concealed IDs,
virtual text due dates, strikethrough for done items, and
auto-indent.
Solution: add buffer module with acwrite scratch buffer, syntax
conceal for /id/ prefixes, right-aligned due date extmarks,
header/done highlighting, indentexpr, and view toggling.
Problem: need to render task lists grouped by category or sorted
by priority with concealed IDs and metadata.
Solution: add category_view and priority_view functions that
produce buffer lines with hidden /id/ prefixes, priority flags,
and line metadata for extmark placement.
Problem: need to extract due dates and categories from task
descriptions typed in the buffer.
Solution: add right-to-left token parser for configurable date
syntax (default 'due:') and cat: metadata keys. Supports
Category: prefix syntax for :Todo add commands.
Problem: need persistent task storage with forward-compatible
schema and unknown field preservation.
Solution: add store module with load/save, add/update/delete,
ID allocation, and UDA round-trip preservation. Data stored at
stdpath('data')/todo/tasks.json with version 1 schema.
Problem: need user-configurable settings with sensible defaults.
Solution: add config module that merges vim.g.todo with defaults
for data_path, default_view, default_category, date_format, and
date_syntax.