From 5c07da02e284a20759e611ffaff48aac84e623e7 Mon Sep 17 00:00:00 2001 From: Uzair Aftab Date: Mon, 8 Jul 2024 08:57:31 +0200 Subject: [PATCH 1/2] feat(editing-support): Add `vim-doge` --- .../editing-support/vim-doge/README.md | 5 +++ .../editing-support/vim-doge/init.lua | 39 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 lua/astrocommunity/editing-support/vim-doge/README.md create mode 100644 lua/astrocommunity/editing-support/vim-doge/init.lua diff --git a/lua/astrocommunity/editing-support/vim-doge/README.md b/lua/astrocommunity/editing-support/vim-doge/README.md new file mode 100644 index 000000000..a4b9b4e1b --- /dev/null +++ b/lua/astrocommunity/editing-support/vim-doge/README.md @@ -0,0 +1,5 @@ +# vim-doge + +(Do)cumentation (Ge)nerator for nearly 20 languages 📚 Generate proper code documentation with a single keypress. ⚡️🔥 + +**Repository:** diff --git a/lua/astrocommunity/editing-support/vim-doge/init.lua b/lua/astrocommunity/editing-support/vim-doge/init.lua new file mode 100644 index 000000000..c5cd15a4e --- /dev/null +++ b/lua/astrocommunity/editing-support/vim-doge/init.lua @@ -0,0 +1,39 @@ +return { + "kkoomen/vim-doge", + build = function() vim.cmd "call doge#install()" end, + cmd = "DogeGenerate", + lazy = false, + dependencies = { + { + "AstroNvim/astrocore", + opts = function(_, opts) + if not opts.options then opts.options = {} end + if not opts.options.g then opts.options.g = {} end + opts.options.g.doge_enable_mappings = 0 + local maps = opts.mappings + maps.n["a"] = { + "(doge-generate)", + desc = "Générer annotation", + } + maps.n[""] = { + "(doge-comment-jump-forward)", + } + maps.n[""] = { + "(doge-comment-jump-backward)", + } + maps.i[""] = { + "(doge-comment-jump-forward)", + } + maps.i[""] = { + "(doge-comment-jump-backward)", + } + maps.x[""] = { + "(doge-comment-jump-forward)", + } + maps.x[""] = { + "(doge-comment-jump-backward)", + } + end, + }, + }, +} From d44cf57c963a5a937b1ee42e427bfbcdf1fa3d5d Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Mon, 8 Jul 2024 07:36:42 -0400 Subject: [PATCH 2/2] fix(vim-doge): use `]D`/`[D` instead of `Tab`/`S-Tab` --- .../editing-support/vim-doge/init.lua | 28 ++++--------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/lua/astrocommunity/editing-support/vim-doge/init.lua b/lua/astrocommunity/editing-support/vim-doge/init.lua index c5cd15a4e..077349bb0 100644 --- a/lua/astrocommunity/editing-support/vim-doge/init.lua +++ b/lua/astrocommunity/editing-support/vim-doge/init.lua @@ -1,7 +1,6 @@ return { "kkoomen/vim-doge", build = function() vim.cmd "call doge#install()" end, - cmd = "DogeGenerate", lazy = false, dependencies = { { @@ -11,28 +10,11 @@ return { if not opts.options.g then opts.options.g = {} end opts.options.g.doge_enable_mappings = 0 local maps = opts.mappings - maps.n["a"] = { - "(doge-generate)", - desc = "Générer annotation", - } - maps.n[""] = { - "(doge-comment-jump-forward)", - } - maps.n[""] = { - "(doge-comment-jump-backward)", - } - maps.i[""] = { - "(doge-comment-jump-forward)", - } - maps.i[""] = { - "(doge-comment-jump-backward)", - } - maps.x[""] = { - "(doge-comment-jump-forward)", - } - maps.x[""] = { - "(doge-comment-jump-backward)", - } + maps.n["a"] = { "(doge-generate)", desc = "Generate annotation" } + for _, mode in ipairs { "n", "i", "s" } do + maps[mode]["]D"] = { "(doge-comment-jump-forward)" } + maps[mode]["[D"] = { "(doge-comment-jump-backward)" } + end end, }, },