Adding neogen and luasnip remaps for doxygen commenting

This commit is contained in:
Daniel 2024-02-23 23:35:05 -05:00
parent 6890147ba9
commit 4d3950fc83
4 changed files with 17 additions and 2 deletions

10
after/plugin/neogen.lua Normal file
View File

@ -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 = "<C-e>" -- (DROPPED SUPPORT, see [here](#cycle-between-annotations) !) The keymap in order to jump in the annotation fields (in insert mode)
}

View File

@ -1,5 +1,5 @@
require("pippy.remap")
require("pippy.lazy")
require("pippy.remap")
vim.opt.nu = true
vim.opt.relativenumber = true

View File

@ -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'},

View File

@ -16,3 +16,8 @@ vim.keymap.set("n", "<leader>sg", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left>
vim.keymap.set("n", "<leader>ss", [[:.,$s/\<<C-r><C-w>\>/<C-r><C-w>/gIc<Left><Left><Left><Left>]]) --Search and replace incremental
vim.keymap.set("n", "<C-f>", [[/\<<C-r><C-w>\>/<CR>]]) -- ctrl find
local opts = { noremap = true, silent = true }
local ls = require("luasnip")
vim.api.nvim_set_keymap("n", "<Leader>nf", ":lua require('neogen').generate()<CR>", opts)
vim.keymap.set({"i", "s"}, "<C-L>", function() ls.jump( 1) end, {silent = true})
vim.keymap.set({"i", "s"}, "<C-J>", function() ls.jump(-1) end, {silent = true})