add annotation generator: neogen

This commit is contained in:
2023-08-02 02:16:29 -04:00
parent f05dc87c0d
commit 394b577d3b
4 changed files with 20 additions and 0 deletions

View File

@ -45,6 +45,7 @@ cmp.event:on(
)
local luasnip = require('luasnip')
local neogen = require('neogen')
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup {
@ -97,6 +98,8 @@ cmp.setup {
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
elseif neogen.jumpable() then
neogen.jump_next()
else
require("intellitab").indent()
end
@ -106,6 +109,8 @@ cmp.setup {
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
elseif neogen.jumpable(true) then
neogen.jump_prev()
else
fallback()
end

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

@ -0,0 +1,10 @@
local status_ok, neogen = pcall(require, "neogen")
if not status_ok then
return
end
neogen.setup {
enabled = true,
input_after_comment = true,
snippet_engine = "luasnip",
}