diff --git a/after/plugin/neogen.lua b/after/plugin/neogen.lua new file mode 100644 index 0000000..93792a3 --- /dev/null +++ b/after/plugin/neogen.lua @@ -0,0 +1,10 @@ +require('neogen').setup { + enabled = true, --if you want to disable Neogen + input_after_comment = true, -- (default: true) automatic jump (with insert mode) on inserted annotation + snippet_engine = "luasnip", + languages = { + ['cpp.doxygen'] = require('neogen.configurations.cpp'), + ['python.numpydoc'] = require('neogen.configurations.python'), + } + -- jump_map = "" -- (DROPPED SUPPORT, see [here](#cycle-between-annotations) !) The keymap in order to jump in the annotation fields (in insert mode) +} diff --git a/lua/pippy/init.lua b/lua/pippy/init.lua index f43315e..cf99f4c 100644 --- a/lua/pippy/init.lua +++ b/lua/pippy/init.lua @@ -1,5 +1,5 @@ -require("pippy.remap") require("pippy.lazy") +require("pippy.remap") vim.opt.nu = true vim.opt.relativenumber = true diff --git a/lua/pippy/lazy.lua b/lua/pippy/lazy.lua index 998e571..b0d77b9 100644 --- a/lua/pippy/lazy.lua +++ b/lua/pippy/lazy.lua @@ -48,8 +48,8 @@ require("lazy").setup({ "folke/neoconf.nvim", cmd = "Neoconf" }, - "folke/neodev.nvim", + {"danymat/neogen", dependencies = "nvim-treesitter/nvim-treesitter", config = true}, {'williamboman/mason.nvim'}, {'williamboman/mason-lspconfig.nvim'}, {'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'}, diff --git a/lua/pippy/remap.lua b/lua/pippy/remap.lua index 60fff83..f5843ae 100644 --- a/lua/pippy/remap.lua +++ b/lua/pippy/remap.lua @@ -16,3 +16,8 @@ vim.keymap.set("n", "sg", [[:%s/\<\>//gI vim.keymap.set("n", "ss", [[:.,$s/\<\>//gIc]]) --Search and replace incremental vim.keymap.set("n", "", [[/\<\>/]]) -- ctrl find +local opts = { noremap = true, silent = true } +local ls = require("luasnip") +vim.api.nvim_set_keymap("n", "nf", ":lua require('neogen').generate()", opts) +vim.keymap.set({"i", "s"}, "", function() ls.jump( 1) end, {silent = true}) +vim.keymap.set({"i", "s"}, "", function() ls.jump(-1) end, {silent = true})