Add a hook that fires after Agentic writes to a file.
The existing on_response_complete hook doesn't provide information about which files were modified. I want to auto-format, lint, or post-process edited files.
{
"carlos-algms/agentic.nvim",
opts = {
hooks = {
on_file_edit = function(data)
-- data.filepath: string - Absolute path to edited file
-- data.session_id: string - ACP session ID
-- data.tab_page_id: number - Neovim tabpage ID
-- data.bufnr: number|nil - Buffer number if loaded
vim.lsp.buf.format({ bufnr = data.bufnr, timeout_ms = 5000 })
end,
}
}
}
Track all buffer writes with BufWritePost autocmd between on_prompt_submit and on_response_complete, but this captures non-Agentic writes too.