From 090ee58a0dafabc2aff95b5b2cf6e0380a674cbc Mon Sep 17 00:00:00 2001 From: Colin Graydon Date: Mon, 21 Apr 2025 09:49:38 -0400 Subject: [PATCH] feat: add doxygen --- lua/plugins/neogen.lua | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/lua/plugins/neogen.lua b/lua/plugins/neogen.lua index e69de29..ce5a76b 100644 --- a/lua/plugins/neogen.lua +++ b/lua/plugins/neogen.lua @@ -0,0 +1,48 @@ +return { + { + "danymat/neogen", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "L3MON4D3/LuaSnip", -- Explicitly add LuaSnip as a dependency + }, + cmd = "Neogen", + opts = { + enabled = true, + snippet_engine = "luasnip", + languages = { + cpp = { template = { annotation_convention = "doxygen" } }, + c = { template = { annotation_convention = "doxygen" } }, + java = { template = { annotation_convention = "doxygen" } }, + python = { template = { annotation_convention = "google_docstrings" } }, + go = { template = { annotation_convention = "godoc" } }, + typescript = { template = { annotation_convention = "jsdoc" } }, + javascript = { template = { annotation_convention = "jsdoc" } }, -- Added JavaScript as well since it uses the same convention + }, + }, + keys = { + -- Create a keybinding to trigger Neogen + { + "nd", + function() + require("neogen").generate() + end, + desc = "Generate Documentation", + }, + -- Optional: Map specific types of documentation + { + "nf", + function() + require("neogen").generate({ type = "func" }) + end, + desc = "Document Function", + }, + { + "nc", + function() + require("neogen").generate({ type = "class" }) + end, + desc = "Document Class", + }, + }, + }, +}